filter
Filters whether a viewer may subscribe to a realtime channel.
Parameters of davo_realtime_can_subscribe Parameter Type Description $can_subscribe bool Default false (fail closed). $channel_type string Channel type, e.g. 'question'. $object_id int The channel's object id. $viewer_id int WordPress user id (0 = guest).
add_filter Copyadd_filter ( 'davo_realtime_can_subscribe' , 'my_filter_callback' , 10 , 4 );
/**
* @param bool $can_subscribe
* @param string $channel_type
* @param int $object_id
* @param int $viewer_id
*/
function my_filter_callback ( $can_subscribe , $channel_type , $object_id , $viewer_id ) {
// Change $can_subscribe as needed, then return it.
return $can_subscribe ;
}src/domains/realtime/repository.php:217
filter
Filters the realtime channel a comment target belongs to.
Parameters of davo_realtime_channel_for_target Parameter Type Description $channel string|null Resolved channel so far, or null. $target_type string Comment target type, e.g. 'question', 'answer'. $target_id int The target's id.
add_filter Copyadd_filter ( 'davo_realtime_channel_for_target' , 'my_filter_callback' , 10 , 3 );
/**
* @param string|null $channel
* @param string $target_type
* @param int $target_id
*/
function my_filter_callback ( $channel , $target_type , $target_id ) {
// Change $channel as needed, then return it.
return $channel ;
}src/domains/realtime/listeners/comments-listener.php:197
filter
Filters how many seconds a client waits before polling again when it falls back from streaming. Defaults to 15.
Parameters of davo_realtime_fallback_poll_seconds Parameter Type Description $seconds int Seconds until the next poll.
Returns int
add_filter Copyadd_filter ( 'davo_realtime_fallback_poll_seconds' , 'my_filter_callback' , 10 , 1 );
/**
* @param int $seconds
*/
function my_filter_callback ( $seconds ) {
// Change $seconds as needed, then return it.
return $seconds ;
}src/domains/realtime/sse.php:181
filter
Filters whether the acting user's ID is kept out of the broadcast payload.
The payload is delivered to every subscriber of the channel, so an actor ID in it tells all of them who performed the action — which defeats anonymous posting when the actor is the author of anonymous content. When true, the payload carries actor_id 0 and the real ID is kept only in the event's own database column; get_events_since() hands it back to that one user, so a client can still recognise its own actions.
Parameters of davo_realtime_hide_actor Parameter Type Description $hide bool Whether to hide the actor. Default false. $channel string Channel identifier, e.g. 'question:123'. $args array<string, mixed> The publish() arguments.
add_filter Copyadd_filter ( 'davo_realtime_hide_actor' , 'my_filter_callback' , 10 , 3 );
/**
* @param bool $hide
* @param string $channel
* @param array<string, mixed> $args
*/
function my_filter_callback ( $hide , $channel , $args ) {
// Change $hide as needed, then return it.
return $hide ;
}src/domains/realtime/repository.php:81
filter
Filters how long, in seconds, a live stream may stay open. Defaults to 55; the value is kept between 10 and 55.
Parameters of davo_realtime_max_connection_seconds Parameter Type Description $seconds int Maximum stream lifetime in seconds.
Returns int
add_filter Copyadd_filter ( 'davo_realtime_max_connection_seconds' , 'my_filter_callback' , 10 , 1 );
/**
* @param int $seconds
*/
function my_filter_callback ( $seconds ) {
// Change $seconds as needed, then return it.
return $seconds ;
}src/domains/realtime/helpers.php:217
filter
Filters how many live streams one anonymous visitor (by IP address) may hold open. Defaults to 3.
Parameters of davo_realtime_max_connections_per_guest_ip Parameter Type Description $limit int Maximum concurrent streams.
Returns int
add_filter Copyadd_filter ( 'davo_realtime_max_connections_per_guest_ip' , 'my_filter_callback' , 10 , 1 );
/**
* @param int $limit
*/
function my_filter_callback ( $limit ) {
// Change $limit as needed, then return it.
return $limit ;
}src/domains/realtime/helpers.php:129
filter
Filters whether a viewer may subscribe to the presence channel.
Parameters of davo_realtime_presence_can_subscribe Parameter Type Description $allowed bool Default: any signed-in user, and only on the site-wide channel. $viewer_id int WordPress user ID.
add_filter Copyadd_filter ( 'davo_realtime_presence_can_subscribe' , 'my_filter_callback' , 10 , 2 );
/**
* @param bool $allowed
* @param int $viewer_id
*/
function my_filter_callback ( $allowed , $viewer_id ) {
// Change $allowed as needed, then return it.
return $allowed ;
}src/domains/realtime/listeners/user-status-listener.php:86
filter
Filters whether a presence change is published.
Parameters of davo_realtime_publish_presence Parameter Type Description $publish bool Whether to publish. Default true. $user_id int User whose status changed. $idle bool Whether the user was marked idle.
add_filter Copyadd_filter ( 'davo_realtime_publish_presence' , 'my_filter_callback' , 10 , 3 );
/**
* @param bool $publish
* @param int $user_id
* @param bool $idle
*/
function my_filter_callback ( $publish , $user_id , $idle ) {
// Change $publish as needed, then return it.
return $publish ;
}src/domains/realtime/listeners/user-status-listener.php:115