Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)
  • @staceym

    Participant

    Here is a solution that works in BuddyPress 1.6. This will prevent new activities from being added and will also prevent the user from showing as recently active. The first option is for admins, the second is for a specific username.

    `
    // Don’t record activity by the site admins or show them as recently active
    function my_admin_stealth_mode(){
    if ( is_site_admin() ) {
    global $bp;
    remove_action(‘wp_head’,’bp_core_record_activity’);
    delete_user_meta($bp->loggedin_user->id, ‘last_activity’);
    }
    }
    add_action(‘init’,’my_admin_stealth_mode’);

    // Don’t record activity for a user or show them as recently active
    function my_user_stealth_mode(){
    $current_user = wp_get_current_user();
    if(is_user_logged_in()) {
    if(‘YourUsername’ == $current_user->user_login) {
    remove_action(‘wp_head’,’bp_core_record_activity’);
    delete_user_meta($current_user->ID, ‘last_activity’);
    }
    }
    }
    add_action(‘init’,’my_user_stealth_mode’);
    `

Viewing 1 replies (of 1 total)
Skip to toolbar