diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:57:26 +0000 |
commit | 30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch) | |
tree | 39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/admin-bar.php | |
parent | Adding upstream version 6.4.3+dfsg1. (diff) | |
download | wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip |
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | wp-includes/admin-bar.php | 61 |
1 files changed, 44 insertions, 17 deletions
diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index b22a7a7..d709de1 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -139,6 +139,9 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) { __( 'About WordPress' ) . '</span>', 'href' => $about_url, + 'meta' => array( + 'menu_title' => __( 'About WordPress' ), + ), ); // Set tabindex="0" to make sub menus accessible when no URL is available. @@ -282,7 +285,10 @@ function wp_admin_bar_my_account_item( $wp_admin_bar ) { 'title' => $howdy . $avatar, 'href' => $profile_url, 'meta' => array( - 'class' => $class, + 'class' => $class, + /* translators: %s: Current user's display name. */ + 'menu_title' => sprintf( __( 'Howdy, %s' ), $current_user->display_name ), + 'tabindex' => ( false !== $profile_url ) ? '' : 0, ), ) ); @@ -325,29 +331,19 @@ function wp_admin_bar_my_account_menu( $wp_admin_bar ) { $user_info .= "<span class='username'>{$current_user->user_login}</span>"; } + if ( false !== $profile_url ) { + $user_info .= "<span class='display-name edit-profile'>" . __( 'Edit Profile' ) . '</span>'; + } + $wp_admin_bar->add_node( array( 'parent' => 'user-actions', 'id' => 'user-info', 'title' => $user_info, 'href' => $profile_url, - 'meta' => array( - 'tabindex' => -1, - ), ) ); - if ( false !== $profile_url ) { - $wp_admin_bar->add_node( - array( - 'parent' => 'user-actions', - 'id' => 'edit-profile', - 'title' => __( 'Edit Profile' ), - 'href' => $profile_url, - ) - ); - } - $wp_admin_bar->add_node( array( 'parent' => 'user-actions', @@ -397,6 +393,9 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) { 'id' => 'site-name', 'title' => $title, 'href' => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(), + 'meta' => array( + 'menu_title' => $title, + ), ) ); @@ -436,6 +435,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' ), + ) + ); + } } } @@ -443,9 +454,9 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) { * Adds the "Edit site" link to the Toolbar. * * @since 5.9.0 + * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. * * @global string $_wp_current_template_id - * @since 6.3.0 Added `$_wp_current_template_id` global for editing of current template directly from the admin bar. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ @@ -482,8 +493,9 @@ function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { * * @since 4.3.0 * - * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * @global WP_Customize_Manager $wp_customize + * + * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_customize_menu( $wp_admin_bar ) { global $wp_customize; @@ -926,6 +938,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { * Adds "Add New" menu. * * @since 3.1.0 + * @since 6.5.0 Added a New Site link for network installations. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ @@ -981,6 +994,9 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { 'id' => 'new-content', 'title' => $title, 'href' => admin_url( current( array_keys( $actions ) ) ), + 'meta' => array( + 'menu_title' => _x( 'New', 'admin bar menu group label' ), + ), ) ); @@ -996,6 +1012,17 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { ) ); } + + if ( is_multisite() && current_user_can( 'create_sites' ) ) { + $wp_admin_bar->add_node( + array( + 'parent' => 'new-content', + 'id' => 'add-new-site', + 'title' => _x( 'Site', 'add new from admin bar' ), + 'href' => network_admin_url( 'site-new.php' ), + ) + ); + } } /** |