Update both of the comment counts when something changes.
git-svn-id: https://develop.svn.wordpress.org/trunk@6545 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
090108bfc8
commit
c3d27d6d18
@ -2,17 +2,21 @@ var list; var extra;
|
||||
jQuery(function($) {
|
||||
|
||||
var dimAfter = function( r, settings ) {
|
||||
var a = $('#awaitmod');
|
||||
$('.comment-count').each( function() {
|
||||
var a = $('#' + this.id );
|
||||
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
|
||||
a.html( n.toString() );
|
||||
});
|
||||
}
|
||||
|
||||
var delAfter = function( r, settings ) {
|
||||
var a = $('#awaitmod');
|
||||
$('.comment-count').each( function() {
|
||||
var a = $('#' + this.id );
|
||||
if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) {
|
||||
var n = parseInt(a.html(),10) - 1;
|
||||
a.html( n.toString() );
|
||||
}
|
||||
});
|
||||
|
||||
if ( extra.size() == 0 || extra.children().size() == 0 ) {
|
||||
return;
|
||||
|
@ -18,7 +18,7 @@ else
|
||||
$awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'");
|
||||
if ( 100 < $awaiting_mod )
|
||||
$awaiting_mod = '99+'; // to not blow out layout
|
||||
$menu[15] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod'>$awaiting_mod</span>" ), 'edit_posts', 'edit-comments.php');
|
||||
$menu[15] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='comment-count'>$awaiting_mod</span>" ), 'edit_posts', 'edit-comments.php');
|
||||
$menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php');
|
||||
$menu[25] = array(__('Design'), 'switch_themes', 'themes.php');
|
||||
$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
|
||||
@ -35,7 +35,7 @@ $submenu['post-new.php'][10] = array(__('Write Page'), 'edit_pages', 'page-new.p
|
||||
|
||||
$submenu['edit-comments.php'][5] = array(__('Comments'), 'edit_posts', 'edit-comments.php');
|
||||
$awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'");
|
||||
$submenu['edit-comments.php'][25] = array(sprintf(__("Awaiting Moderation (%s)"), "<span id='awaitmod'>$awaiting_mod</span>"), 'edit_posts', 'moderation.php');
|
||||
$submenu['edit-comments.php'][25] = array(sprintf(__("Awaiting Moderation (%s)"), "<span id='awaitmod' class='comment-count'>$awaiting_mod</span>"), 'edit_posts', 'moderation.php');
|
||||
|
||||
|
||||
$submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php');
|
||||
|
Loading…
Reference in New Issue
Block a user