Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'd like to exclude a specific user account from showing up in the activity stream. I found this code that's supposed to exclude the Admin. Any clue how to exclude a specific user? (this code goes in bp-custom.php)

<?php 
add_action("plugins_loaded","bpdev_init_sm_mode");
function bpdev_init_sm_mode(){
if(is_site_admin())
remove_action("wp_head","bp_core_record_activity");//id SM is on, remove the record activity hook
}
?>

Thank you.

share|improve this question

1 Answer 1

up vote 2 down vote accepted
<?php
add_action("plugins_loaded","bpdev_init_sm_mode");
function bpdev_init_sm_mode(){
    global $current_user;
    if(is_user_logged_in()) {
        get_currentuserinfo();
        if("someusername" == $current_user->user_login) {
            remove_action("wp_head","bp_core_record_activity");//id SM is on, remove the record activity hook
        }
    }
}
?>
share|improve this answer
    
Looks real good, but I put the code into bp-custom.php and activity is still recorded for that user. Thanks for the answer. If it helps, here is a link to where I originally got the code from: link –  Pwn May 22 '11 at 9:10
1  
I just tested the original code, and that doesn't work either! SO i guess maybe it's for an older version of Buddypress. –  Pwn May 22 '11 at 9:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.