Forum Replies Created
-
In reply to: Notificatons only for admin visible
actually now that i think about it a little more… you should replace the current_user_can() function with the
is_admin()function instead.In reply to: Notificatons only for admin visiblehere’s some clues:
First you need to check the user’s role/capabilities and then remove the navigation menu for these users. For me, I used:
if (current_user_can('none_admin_role')){bp_core_remove_nav_item( 'notifications');}} add_action( 'wp', 'bp_remove_nav_item' );You then still need to remove it from the admin bar. My code:
function my_remove_admin_menu(){ global $wp_admin_bar; if (current_user_can('none_admin_role')) { $wp_admin_bar->remove_menu('notifications'); } } add_action('bp_setup_admin_bar', 'my_remove_admin_menu',301);hopefully, this does the trick for you. I took me while to figure this out…goodluck.
In reply to: Hide admin bar component for some usersFound the solution! It was written up in the documentation! HERE
For my needs, I filtered based on roles like so:
function my_remove_activity_menu(){ if (current_user_can('special_role')) { global $wp_admin_bar; $wp_admin_bar->remove_menu('my-account-activity'); } } add_action('bp_setup_admin_bar', 'my_remove_activity_menu',301);Good luck everyone.
In reply to: Hide admin bar component for some usersafter a shower — it came to me that I should just hide the menu item in CSS with the following:
#wp-admin-bar-my-account-activity{display:none;}But this hides it from everyone… does anyone else have a better idea?