Support » Fixing WordPress » Extra elements in admin bar

  • Resolved DomenLo

    (@domenlo)


    I’d like to add “Plugins” and “Add new plugin” to the Network admin dropdown in the admin bar.

    What would be the easiest way to go about this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • This works for me…I’m not sure if you can somehow combine the two items and only call $admin_bar->add_menu( $args); once.

    add_action('admin_bar_menu', 'add_items',  100);
    function add_items($admin_bar)
    {
        $args = array(
                'id'    => 'plugins',
                'title' => 'Plugins',
                'href'  => 'plugins.php',
                'meta'  => array(
                        'title' => __('Plugins'),
                        ),
                );
    
        $admin_bar->add_menu( $args);
        $args = array(
                'id'     => 'add-plugin',
                'title'  => 'Add New',
                'href'   => 'plugin-install.php',
                'meta'   => array(
                        'title' => __('Add New Plugin'),
                        ),
                'parent' => 'plugins',
                );
    
        $admin_bar->add_menu( $args);
    }

    EDIT: This should go into your theme’s functions.php file.

    Thank you very very much.

    No problem!

    In case anyone stumbles on this topic, this also came out recently: http://wordpress.org/extend/plugins/multisite-admin-bar-tweaks/

    Both variants work flawlessly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Extra elements in admin bar’ is closed to new replies.