Last active
December 22, 2015 21:09
-
-
Save deltafactory/6531278 to your computer and use it in GitHub Desktop.
BuddyPress snippet to remove "affiliate" users from the list of active users.
This file contains hidden or 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 | |
//Code is completely untested, may contain errors. | |
function affiliate_user_stealth_mode() { | |
if ( ! is_user_logged_in() ) | |
return; | |
$user = wp_get_current_user(); | |
if ( get_user_meta( $user->ID, 'affiliate', true ) ) { | |
remove_action( 'wp_head', 'bp_core_record_activity' ); | |
delete_user_meta( $user->ID, 'last_activity' ); | |
} | |
} | |
add_action( 'init', 'affiliate_user_stealth_mode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment