0 ? min( $limit, 100 ) : 20;
self::enqueue_assets();
$manager = new ForWP_Notifications_Manager();
$items = $manager->get_for_user( null, $limit, 0 );
$rest_url = rest_url( ForWP_Notifications_REST_Controller::NAMESPACE );
$nonce = wp_create_nonce( 'wp_rest' );
$poll_interval = 30000;
$empty_text = __( 'No notifications.', '4wp-notifications' );
ob_start();
?>
$item Notification row.
*/
public static function render_item( $item ) {
$is_read = ( (int) $item['is_read'] ) === 1;
$source = isset( $item['source'] ) ? $item['source'] : '';
$item_icon_class = ForWP_Notifications_Bell_Renderer::get_item_icon_class( $source );
$toggle_label = $is_read ? __( 'Mark as unread', '4wp-notifications' ) : __( 'Mark as read', '4wp-notifications' );
$toggle_icon = $is_read ? 'dashicons-hidden' : 'dashicons-visibility';
$toggle_class = '4wp-notifications__toggle' . ( $is_read ? ' 4wp-notifications__toggle--read' : '' );
?>