Make WordPress Core


Ignore:
Timestamp:
03/04/2024 09:48:29 PM (15 months ago)
Author:
joedolson
Message:

Toolbar: Polish design and code combining duplicate profile links.

Fixes some design changes and improves quality of comments and code styles following previous changes. Follow-up to [57708].

Props sabernhardt, huzaifaalmesbah, joedolson.
Fixes #43633. See #34668.

File:
1 edited

Legend:

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

    r57747 r57765  
    140140            '</span>',
    141141        'href'  => $about_url,
    142         'meta' => array(
     142        'meta'  => array(
    143143            'menu_title' => __( 'About WordPress' ),
    144144        ),
     
    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        )
     
    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(
     
    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            ),
     
    991995            'title' => $title,
    992996            'href'  => admin_url( current( array_keys( $actions ) ) ),
    993             'meta' => array(
     997            'meta'  => array(
    994998                'menu_title' => _x( 'New', 'admin bar menu group label' ),
    995999            ),
Note: See TracChangeset for help on using the changeset viewer.