Bimal Poudel
Bimal Poudel

Reputation: 1234

WordPress menu add link to plugins

When the admin is logged in and is in front end area, there is a small dropdown of the quick menus. How can I add link to plugins page here?

enter image description here

Upvotes: 0

Views: 61

Answers (1)

Aleksander Tabor
Aleksander Tabor

Reputation: 128

function my_tweaked_admin_bar() {
    global $wp_admin_bar;

    $wp_admin_bar->add_menu( array(
        'id'    => 'plugins',
        'title' => 'Plugins',
        'href'  => get_site_url().'/wp-admin/plugins.php',
        'parent'=> 'site-name'
    ));
}
add_action( 'wp_before_admin_bar_render', 'my_tweaked_admin_bar' );

Just paste this code in functions.php in your current theme's directory.

For more information check WordPress Codex: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_before_admin_bar_render

Upvotes: 1

Related Questions