Seeing that the referenced answer stores users_online
as an array of timestamps indexed by user ID, you can use the include
argument for WP_User_Query
:
$args = array(
'include' => array_keys( $logged_in_users ),
// Other arguments
);
Seeing that the referenced answer stores users_online
as an array of timestamps indexed by user ID, you can use the include
argument for WP_User_Query
:
$args = array(
'include' => array_keys( $logged_in_users ),
// Other arguments
);