• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Add Plugins shortcut to admin toolbar

InvisibleRasta

Active member
Babiato Fan
Babiato Lover
Nov 6, 2020
156
62
28
Hello guys, I have been using this small script to add some options on my wordpress Admin Toolbar and I tought I could share it with you. It has been making my life much easier when updating/installing plugins. You have to place it in your theme/child-theme functions.php file.

Code:
//Add Plugins on admin bar
add_action('admin_bar_menu', 'add_toolbar_items', 100);
function add_toolbar_items($admin_bar){
    $admin_bar->add_menu( array(
        'id'    => 'plugins-page',
        'title' => '⚠️ Plugins',
        'href'  => '/wp-admin/plugins.php',
        'meta'  => array(
            'title' => __('All plugins'),
        ),
    ));
    $admin_bar->add_menu( array(
        'id'    => 'active-plugins',
        'parent' => 'plugins-page',
        'title' => 'Active',
        'href'  => '/wp-admin/plugins.php?plugin_status=active',
        'meta'  => array(
            'title' => __('Active Plugins'),
            'target' => '_blank',
            'class' => 'my_menu_item_class'
        ),
    ));
    $admin_bar->add_menu( array(
        'id'    => 'inactive-plugins',
        'parent' => 'plugins-page',
        'title' => 'Inactive',
        'href'  => '/wp-admin/plugins.php?plugin_status=inactive',
        'meta'  => array(
            'title' => __('Inactive plugins'),
            'target' => '_blank',
            'class' => 'my_menu_item_class'
        ),
    ));
      $admin_bar->add_menu( array(
        'id'    => 'add-plugin',
        'parent' => 'plugins-page',
        'title' => 'Install Plugin',
        'href'  => '/wp-admin/plugin-install.php',
        'meta'  => array(
            'title' => __('Install Plugin'),
            'target' => '_blank',
            'class' => 'my_menu_item_class'
        ),
    ));
        $admin_bar->add_menu( array(
        'id'    => 'add-plugins',
        'parent' => 'new-content',
        'title' => 'Plugin',
        'href'  => '/wp-admin/plugin-install.php',
        'meta'  => array(
            'title' => __('Install plugin'),
            'target' => '_blank',
            'class' => 'my_menu_item_class'
        ),
    ));
}
 
  • Like
Reactions: the1magoo
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock