Make WordPress Core


Ignore:
Timestamp:
12/13/2010 08:35:28 PM (14 years ago)
Author:
ryan
Message:

Admin bar sprite cleanups. Props ocean90, darrenmeehan. see #15611

File:
1 edited

Legend:

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

    r16862 r16897  
    6868
    6969/**
    70  * Show the logged in user's gravatar as a separator.
    71  *
    72  * @since 3.1.0
    73  */
    74 function wp_admin_bar_me_separator() {
    75     global $wp_admin_bar;
    76     $user_id = get_current_user_id();
    77     if ( 0 != $user_id )
    78         $wp_admin_bar->add_menu( array( 'id' => 'me', 'title' => get_avatar( get_current_user_id(), 16 ), 'href' => get_edit_profile_url( $user_id ), ) );
    79 }
    80 
    81 /**
    8270 * Add the "My Account" menu and all submenus.
    8371 *
     
    9179    if ( 0 != $user_id ) {
    9280        /* Add the 'My Account' menu */
    93         $wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $user_identity,  'href' => get_edit_profile_url( $user_id ) ) );
     81        $avatar = get_avatar( get_current_user_id(), 16 );
     82        $wp_admin_bar->add_menu( array( 'id' => 'my-account', 'title' => $avatar . $user_identity,  'href' => get_edit_profile_url( $user_id ) ) );
    9483
    9584        /* Add the "My Account" sub menus */
     
    148137
    149138/**
    150  * Show the blavatar of the current site as a separator.
    151  *
    152  * @since 3.1.0
    153  */
    154 function wp_admin_bar_blog_separator() {
    155     global $wp_admin_bar, $current_blog;
    156     $default = includes_url('images/wpmini-blue.png');
    157     $wp_admin_bar->add_menu( array( 'id' => 'blog', 'title' => '<img class="avatar" src="' . $default . '" alt="' . esc_attr__( 'Current site avatar' ) . '" width="16" height="16" />',  'href' => home_url(), ) );
    158 }
    159 
    160 
    161 /**
    162139 * Provide a shortlink.
    163140 *
     
    193170}
    194171
     172/**
     173 * Add "Add New" menu.
     174 *
     175 * @since 3.1.0
     176 */
    195177function wp_admin_bar_new_content_menu() {
    196178    global $wp_admin_bar;
     
    200182        if ( true !== $ptype_obj->show_in_menu || ! current_user_can( $ptype_obj->cap->edit_posts ) )
    201183            continue;
     184
    202185        $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->edit_posts, 'new-' . $ptype_obj->name );
    203186    }
     
    213196}
    214197
     198/**
     199 * Add edit comments link with awaiting moderation count bubble.
     200 *
     201 * @since 3.1.0
     202 */
    215203function wp_admin_bar_comments_menu() {
    216204    global $wp_admin_bar;
     
    226214}
    227215
     216/**
     217 * Add "Appearance" menu with widget and nav menu submenu.
     218 *
     219 * @since 3.1.0
     220 */
    228221function wp_admin_bar_appearance_menu() {
    229222    global $wp_admin_bar;
     
    244237}
    245238
     239/**
     240 * Provide an update link if theme/plugin/core updates are available.
     241 *
     242 * @since 3.1.0
     243 */
    246244function wp_admin_bar_updates_menu() {
    247245    global $wp_admin_bar;
Note: See TracChangeset for help on using the changeset viewer.