Last active
February 3, 2020 17:03
-
-
Save sadrul/f6ab4d7dae5261879489 to your computer and use it in GitHub Desktop.
Buddypress user last activity insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_head', 'record_user_last_activity' ); | |
function record_user_last_activity(){ | |
$get_users = get_users( array( 'fields' => array( 'ID' ) ) ); | |
if(!empty($get_users)){ | |
foreach($get_users as $single){ | |
bp_update_user_last_activity($single->ID); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment