Make WordPress Core

Ticket #43633: 43633.5.diff

File 43633.5.diff, 2.6 KB (added by sabernhardt, 11 months ago)

restores ( false !== $profile_url ) check, adds display-name class, adds zero tabindex to profile menu without a link, removes grid row-gap, adds another space after 'meta', capitalizes the ARIA acronym, adds a translator comment

  • src/wp-includes/admin-bar.php

     
    139139                                __( 'About WordPress' ) .
    140140                        '</span>',
    141141                'href'  => $about_url,
    142                 'meta' => array(
     142                'meta'  => array(
    143143                        'menu_title' => __( 'About WordPress' ),
    144144                ),
    145145        );
     
    286286                        'href'   => $profile_url,
    287287                        'meta'   => array(
    288288                                'class'      => $class,
     289                                /* translators: %s: Current user's display name. */
    289290                                'menu_title' => sprintf( __( 'Howdy, %s' ), $current_user->display_name ),
     291                                'tabindex'   => ( false !== $profile_url ) ? '' : 0,
    290292                        ),
    291293                )
    292294        );
     
    329331                $user_info .= "<span class='username'>{$current_user->user_login}</span>";
    330332        }
    331333
    332         $user_info .= "<span class='edit-profile'>" . __( 'Edit Profile' ) . '</span>';
     334        if ( false !== $profile_url ) {
     335                $user_info .= "<span class='display-name edit-profile'>" . __( 'Edit Profile' ) . '</span>';
     336        }
    333337
    334338        $wp_admin_bar->add_node(
    335339                array(
     
    389393                        'id'    => 'site-name',
    390394                        'title' => $title,
    391395                        'href'  => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(),
    392                         'meta' => array(
     396                        'meta'  => array(
    393397                                'menu_title' => $title,
    394398                        ),
    395399                )
     
    989993                        'id'    => 'new-content',
    990994                        'title' => $title,
    991995                        'href'  => admin_url( current( array_keys( $actions ) ) ),
    992                         'meta' => array(
     996                        'meta'  => array(
    993997                                'menu_title' => _x( 'New', 'admin bar menu group label' ),
    994998                        ),
    995999                )
  • src/wp-includes/class-wp-admin-bar.php

     
    506506         * @since 6.5.0 Added `$menu_title` parameter to allow an ARIA menu name.
    507507         *
    508508         * @param object $node
    509          * @param string|bool $menu_title The accessible name of this aria menu or false if not provided.
     509         * @param string|bool $menu_title The accessible name of this ARIA menu or false if not provided.
    510510         */
    511511        final protected function _render_group( $node, $menu_title = false ) {
    512512                if ( 'container' === $node->type ) {
  • src/wp-includes/css/admin-bar.css

     
    447447        background: none;
    448448}
    449449
    450 #wpadminbar #wp-admin-bar-user-info a {
    451         display: grid;
    452         row-gap: 12px;
    453 }
    454 
    455450#wp-admin-bar-user-info .avatar {
    456451        position: absolute;
    457452        left: -72px;