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!
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!
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.
You must log in to post.