Changeset 16897 for trunk/wp-includes/admin-bar.php
- Timestamp:
- 12/13/2010 08:35:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r16862 r16897 68 68 69 69 /** 70 * Show the logged in user's gravatar as a separator.71 *72 * @since 3.1.073 */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 /**82 70 * Add the "My Account" menu and all submenus. 83 71 * … … 91 79 if ( 0 != $user_id ) { 92 80 /* 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 ) ) ); 94 83 95 84 /* Add the "My Account" sub menus */ … … 148 137 149 138 /** 150 * Show the blavatar of the current site as a separator.151 *152 * @since 3.1.0153 */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 /**162 139 * Provide a shortlink. 163 140 * … … 193 170 } 194 171 172 /** 173 * Add "Add New" menu. 174 * 175 * @since 3.1.0 176 */ 195 177 function wp_admin_bar_new_content_menu() { 196 178 global $wp_admin_bar; … … 200 182 if ( true !== $ptype_obj->show_in_menu || ! current_user_can( $ptype_obj->cap->edit_posts ) ) 201 183 continue; 184 202 185 $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->edit_posts, 'new-' . $ptype_obj->name ); 203 186 } … … 213 196 } 214 197 198 /** 199 * Add edit comments link with awaiting moderation count bubble. 200 * 201 * @since 3.1.0 202 */ 215 203 function wp_admin_bar_comments_menu() { 216 204 global $wp_admin_bar; … … 226 214 } 227 215 216 /** 217 * Add "Appearance" menu with widget and nav menu submenu. 218 * 219 * @since 3.1.0 220 */ 228 221 function wp_admin_bar_appearance_menu() { 229 222 global $wp_admin_bar; … … 244 237 } 245 238 239 /** 240 * Provide an update link if theme/plugin/core updates are available. 241 * 242 * @since 3.1.0 243 */ 246 244 function wp_admin_bar_updates_menu() { 247 245 global $wp_admin_bar;
Note: See TracChangeset
for help on using the changeset viewer.