I have a multisite installation on example.com and users have site in example.com/user1. I would like disable on admin bar(My Sites) only the site number with id number 1(example.com), so the user can't see it on admin bar when logged, and will see My Sites/user1 . I tryed this hook, but it disables everything on 'my-sites', is there any method for to do that?
function myfunction_admin_bar_render() {
global $wp_admin_bar, $current_user;
if ($current_user->ID != 1) {
$wp_admin_bar->remove_menu('my-sites');
}
}
add_action( 'wp_before_admin_bar_render', 'myfunction_admin_bar_render' );