Make WordPress Core


Ignore:
Timestamp:
05/11/2011 07:05:47 AM (15 years ago)
Author:
koopersmith
Message:

Improve 'howdy' dropdown styles, add 'your profile' item and no-js. see #17324.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r17844 r17853  
    144144
    145145// Generate user profile and info links.
    146 $howdy = sprintf( __('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity );
     146$howdy = sprintf( __('Howdy, %1$s'), $user_identity );
    147147$links = array();
     148
     149$links[5] = '<a href="profile.php" title="' . esc_attr__('Edit your profile') . '">' . __('Your Profile') . '</a>';
    148150
    149151if ( is_multisite() && is_super_admin() ) {
     
    153155        $links[10] = '<a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
    154156}
     157
    155158$links[15] = '<a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
    156159
     
    160163// Trim whitespace and pipes from links, then convert to list items.
    161164$links = array_map( 'trim', $links, array_fill( 0, count( $links ), " |\n\t" ) );
    162 $links = '<li>' . implode( '</li><li>', $links ) . '</li>';
     165
     166$links_no_js = implode( ' | ', $links );
     167$links_js = '<li>' . implode( '</li><li>', $links ) . '</li>';
    163168
    164169?>
     
    166171<div id="wphead-info">
    167172<div id="user_info">
    168     <p><?php echo $howdy; ?></p>
    169     <div id="user_info_arrow"></div>
    170     <div id="user_info_links_wrap"><div id="user_info_links">
    171         <ul><?php echo $links; ?></ul>
    172     </div></div>
     173    <p class="hide-if-js"><?php echo "$howdy | $links_no_js"; ?></p>
     174
     175    <div class="hide-if-no-js">
     176        <p><?php echo $howdy; ?></p>
     177        <div id="user_info_arrow"></div>
     178        <div id="user_info_links_wrap"><div id="user_info_links">
     179            <ul><?php echo $links_js; ?></ul>
     180        </div></div>
     181    </div>
    173182</div>
    174183</div>
Note: See TracChangeset for help on using the changeset viewer.