Make WordPress Core

Changeset 57188


Ignore:
Timestamp:
12/13/2023 09:16:04 PM (14 months ago)
Author:
SergeyBiryukov
Message:

Toolbar: Add a Plugins link to the admin bar menu.

Props colomet, Girishpanchal, afercia, danieltj, rishishah, sabernhardt, joedolson, huzaifaalmesbah, shailu25, zunaid321, devmuhib, sumitbagthariya16, yuvrajsinh2211, SergeyBiryukov.
Fixes #40683.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r56720 r57188  
    437437        // Add the appearance submenu items.
    438438        wp_admin_bar_appearance_menu( $wp_admin_bar );
     439
     440        // Add a Plugins link.
     441        if ( current_user_can( 'activate_plugins' ) ) {
     442            $wp_admin_bar->add_node(
     443                array(
     444                    'parent' => 'site-name',
     445                    'id'     => 'plugins',
     446                    'title'  => __( 'Plugins' ),
     447                    'href'   => admin_url( 'plugins.php' ),
     448                )
     449            );
     450        }
    439451    }
    440452}
Note: See TracChangeset for help on using the changeset viewer.