• Is it possible to just display “Network Admin” instead of “Network Admin: Network Title” in the admin toolbar?

Viewing 2 replies - 1 through 2 (of 2 total)
  • function changes_my_sites($admin_bar) {
    	if (current_user_can('manage_network'))
    
    	$admin_bar->add_menu( array(
    		'id'    => 'c-network-admin',
    		'parent' => 'c-my-sites',
    		'title' => 'Network Dashboard',
    		'href'  => network_admin_url(),
    	));
    
    	$admin_bar->add_menu( array(
    		'id'    => 'c-network-sites',
    		'parent' => 'c-my-sites',
    		'title' => 'Network Sites',
    		'href'  => network_admin_url('sites.php'),
    	));
    
    	$admin_bar->add_menu( array(
    		'id'    => 'c-network-users',
    		'parent' => 'c-my-sites',
    		'title' => 'Network Users',
    		'href'  => network_admin_url('users.php'),
    	));
    
    }
    add_action('admin_bar_menu', 'changes_my_sites', 20);

    Please use above code but change id and title …

    Thread Starter M3

    (@emmtre)

    Many thanx for your code suggestion. It was the “Network Admin” toolbar menu I was trying to change. So this is what I’m using right now.

    //* Disable toolbar site name
    add_action( 'wp_before_admin_bar_render', 'disable_site_name' );
    function disable_site_name() {
    	global $wp_admin_bar;
    	if ( is_network_admin() ) {
    		$wp_admin_bar->remove_menu( 'site-name' );
    	}
    }
    //* Enable toolbar network title
    add_action( 'admin_bar_menu', 'enable_network_title', 30 );
    function enable_network_title() {
    	global $wp_admin_bar;
    	if ( is_network_admin() ) {
    		$wp_admin_bar->add_menu( array(
    			'id' => 'network-title',
    			'title' => __('Network Admin'),
    			'href' => network_admin_url(),
    		) );
    		$wp_admin_bar->add_menu( array(
    			'parent' => 'network-title',
    			'id' => 'network-sites',
    			'title' => __( 'All Sites' ),
    			'href' => network_admin_url( 'sites.php' ),
    		) );
    		$wp_admin_bar->add_menu( array(
    			'parent' => 'network-title',
    			'id' => 'network-updates',
    			'title' => __( 'Updates' ),
    			'href' => network_admin_url( 'update-core.php' ),
    		) );
    		$wp_admin_bar->add_menu( array(
    			'parent' => 'network-title',
    			'id' => 'network-settings',
    			'title' => __( 'Settings' ),
    			'href' => network_admin_url( 'settings.php' ),
    		) );
    	}
    }
    #wpadminbar #wp-admin-bar-network-title>.ab-item:before {
    	content: '\f319';
    	font-size: 18px;
    	position: relative;
    	top: 3px;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display No Network Title In Toolbar’ is closed to new replies.