filter
Filters the full status entry array before it is returned.
Parameters of davo_user_status_entry Parameter Type Description $entry array<string, mixed> The status entry. $user_id int WordPress user ID.
add_filter Copyadd_filter ( 'davo_user_status_entry' , 'my_filter_callback' , 10 , 2 );
/**
* @param array<string, mixed> $entry
* @param int $user_id
*/
function my_filter_callback ( $entry , $user_id ) {
// Change $entry as needed, then return it.
return $entry ;
}src/domains/user-status/helpers.php:158
filter
Filters the computed user status string before it is returned.
Parameters of davo_user_status_entry_status Parameter Type Description $status string Computed status: 'online', 'idle', or 'offline'. $user_id int WordPress user ID. $last_active int|null Raw last-active Unix timestamp. $idle bool Whether the client reported the user as idle.
add_filter Copyadd_filter ( 'davo_user_status_entry_status' , 'my_filter_callback' , 10 , 4 );
/**
* @param string $status
* @param int $user_id
* @param int|null $last_active
* @param bool $idle
*/
function my_filter_callback ( $status , $user_id , $last_active , $idle ) {
// Change $status as needed, then return it.
return $status ;
}src/domains/user-status/helpers.php:130
filter
Filters the number of seconds a user remains present after the last heartbeat.
Parameters of davo_user_status_threshold Parameter Type Description $threshold int Threshold in seconds. $user_id int WordPress user ID.
add_filter Copyadd_filter ( 'davo_user_status_threshold' , 'my_filter_callback' , 10 , 2 );
/**
* @param int $threshold
* @param int $user_id
*/
function my_filter_callback ( $threshold , $user_id ) {
// Change $threshold as needed, then return it.
return $threshold ;
}src/domains/user-status/repository.php:248
action
Fires after a user's activity has been recorded.
Parameters of davo_user_status_touched Parameter Type Description $user_id int WordPress user ID. $now int Unix timestamp that was stored. $idle bool Whether the user was marked idle.
add_action Copyadd_action ( 'davo_user_status_touched' , 'my_action_callback' , 10 , 3 );
/**
* @param int $user_id
* @param int $now
* @param bool $idle
*/
function my_action_callback ( $user_id , $now , $idle ) {
// Your code here.
}src/domains/user-status/repository.php:86