Improve comments item in admin bar. see #18197.
git-svn-id: https://develop.svn.wordpress.org/trunk@18696 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
edeae501f1
commit
6244ba8f6e
|
@ -190,27 +190,27 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
|
|||
if ( is_user_logged_in() ) {
|
||||
// Add blog links
|
||||
$blue_wp_logo_url = includes_url('images/wpmini-blue.png');
|
||||
|
||||
|
||||
foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
|
||||
// Skip the current blog (unless we're in the network/user admin).
|
||||
if ( $blog->userblog_id == get_current_blog_id() && ! is_network_admin() && ! is_user_admin() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// @todo Replace with some favicon lookup.
|
||||
//$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $blue_wp_logo_url ) ) . '" alt="Blavatar" width="16" height="16" />';
|
||||
$blavatar = '<img src="' . esc_url($blue_wp_logo_url) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>';
|
||||
|
||||
|
||||
$blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
|
||||
|
||||
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url($blog->userblog_id) ) );
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id) ) );
|
||||
|
||||
|
||||
if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) {
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php') ) );
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php') ) );
|
||||
}
|
||||
|
||||
|
||||
$wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id) ) );
|
||||
}
|
||||
}
|
||||
|
@ -358,16 +358,21 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
|||
return;
|
||||
|
||||
$awaiting_mod = wp_count_comments();
|
||||
$awaiting_mod = number_format_i18n( $awaiting_mod->moderated );
|
||||
$awaiting_mod = $awaiting_mod->moderated;
|
||||
|
||||
$bubble = "<div class='ab-comments-bubble'>";
|
||||
$bubble .= "<div class='ab-comments-count'>$awaiting_mod</div>";
|
||||
$bubble .= "<div class='ab-comments-arrow'></div>";
|
||||
$bubble .= "</div>";
|
||||
$icon = "<div class='ab-comments-icon'>";
|
||||
$icon .= "<div class='ab-comments-icon-body'></div>";
|
||||
$icon .= "<div class='ab-comments-icon-arrow'></div>";
|
||||
$icon .= "</div>";
|
||||
|
||||
if ( $awaiting_mod )
|
||||
$title = sprintf( _n('%d Comment', '%d Comments', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
|
||||
else
|
||||
$title = __('Comments');
|
||||
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'id' => 'comments',
|
||||
'title' => $bubble,
|
||||
'title' => $icon . $title,
|
||||
'href' => admin_url('edit-comments.php'),
|
||||
) );
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -345,42 +345,40 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* Comments bubble
|
||||
* Comments icon
|
||||
*/
|
||||
#wpadminbar .ab-comments-bubble {
|
||||
#wpadminbar .ab-comments-icon {
|
||||
position: relative;
|
||||
padding-top: 5px;
|
||||
float: left;
|
||||
}
|
||||
#wpadminbar .ab-comments-count {
|
||||
background: #ccc;
|
||||
color: #555;
|
||||
text-shadow: none;
|
||||
height: 1.2em;
|
||||
line-height: 1.2em;
|
||||
padding: 0 8px 0;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
#wpadminbar .ab-comments-icon-body {
|
||||
margin: 3px 4px 0 -2px;
|
||||
background: #999;
|
||||
height: 10px;
|
||||
width: 14px;
|
||||
|
||||
-moz-border-radius: 10px;
|
||||
-khtml-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#wpadminbar a:hover .ab-comments-count {
|
||||
#wpadminbar a:hover .ab-comments-icon-body {
|
||||
background: #bbb;
|
||||
color: #333;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
#wpadminbar a .ab-comments-arrow {
|
||||
#wpadminbar a .ab-comments-icon-arrow {
|
||||
height: 0;
|
||||
position: absolute;
|
||||
bottom: -4px;
|
||||
left: 6px;
|
||||
bottom: -3px;
|
||||
left: 1px;
|
||||
/* Use transparent borders to form a triangle */
|
||||
border-left: 5px solid #ccc;
|
||||
border-bottom: 5px solid transparent;
|
||||
border-left: 4px solid #999;
|
||||
border-bottom: 4px solid transparent;
|
||||
}
|
||||
#wpadminbar a:hover .ab-comments-arrow {
|
||||
#wpadminbar a:hover .ab-comments-icon-arrow {
|
||||
border-left-color: #bbb;
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,7 @@ function wp_default_styles( &$styles ) {
|
|||
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u1' );
|
||||
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
|
||||
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
|
||||
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110916' );
|
||||
$styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110916b' );
|
||||
$styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101224' );
|
||||
$styles->add( 'editor-buttons', "/wp-includes/css/editor-buttons$suffix.css", array(), '20110802' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue