Reply To: [Tips] Buddypress Hiding Admin/specific user member & activity
@ubernaut: Thank you very much for your response, What information do I need to provide you to check what is the issue ?
I made a new file with the name bp-custom.php with this code
<?php
// Code for: 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’);
//Code for: 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(’admin’ == $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’);
?>
and placed it in plugin folder of the wp installation. It is not giving any error but admin activity is showing in the activity. One more thing I need to know, whether it will remove previous activity as well or not ? and do I need to change the account name to admin ?
Thanks a ton in advance.