From 09ec7e29090f002a1c16ea1b042c62597cecded7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 13 Dec 2023 21:16:04 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@57188 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/admin-bar.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index b22a7a77c3648..3eba2668fa20c 100644 --- a/src/wp-includes/admin-bar.php +++ b/src/wp-includes/admin-bar.php @@ -436,6 +436,18 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) { // Add the appearance submenu items. wp_admin_bar_appearance_menu( $wp_admin_bar ); + + // Add a Plugins link. + if ( current_user_can( 'activate_plugins' ) ) { + $wp_admin_bar->add_node( + array( + 'parent' => 'site-name', + 'id' => 'plugins', + 'title' => __( 'Plugins' ), + 'href' => admin_url( 'plugins.php' ), + ) + ); + } } }