2

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.

2
<?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
        }
    }
}
?>
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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