Clanbite Notifications

apply_filters( 'clanbite_notification_poll_transport', WP_REST_Response|null $response, int $user_id, string $since, int $last_id, WP_REST_Request $request )

Filter to use alternative transport (e.g., WebSockets).

Return a WP_REST_Response to bypass polling entirely.

Filter PHP

Parameters

$response (WP_REST_Response|null)

Response or null to continue with polling.

$user_id (int)

User ID.

$since (string)

Since timestamp.

$last_id (int)

Last notification ID.

$request (WP_REST_Request)

Original request.

Example

add_filter( 'clanbite_notification_poll_transport', function ( $response, $user_id, $since, $last_id, $request ) {
	// Change $response here.
	return $response;
}, 10, 5 );

Defined in inc/extensions/notifications/class-notification-rest-controller.php