mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
Shows pending moderation comments in title and bold comment numbers with comments that need attention.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
764f50bd3d
commit
51ce46e892
@ -57,8 +57,16 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
case 'comments':
|
||||
?>
|
||||
<td style="text-align: center">
|
||||
<?php comments_number("<a href='edit.php?p=$id&c=1'>" . __('0') . '</a>', "<a href='edit.php?p=$id&c=1'>" . __('1') . '</a>', "<a href='edit.php?p=$id&c=1'>" . __('%') . '</a>') ?>
|
||||
</td>
|
||||
<?php
|
||||
$left = get_pending_comments_num( $post->ID );
|
||||
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
|
||||
if ( $left )
|
||||
echo '<strong>';
|
||||
comments_number("<a href='edit.php?p=$id&c=1' title='$pending_phrase'>" . __('0') . '</a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase'>" . __('1') . '</a>', "<a href='edit.php?p=$id&c=1' title='$pending_phrase'>" . __('%') . '</a>');
|
||||
if ( $left )
|
||||
echo '</strong>';
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
|
@ -58,4 +58,11 @@ function get_comment_to_edit( $id ) {
|
||||
return $comment;
|
||||
}
|
||||
|
||||
function get_pending_comments_num( $post_id ) {
|
||||
global $wpdb;
|
||||
$post_id = (int) $post_id;
|
||||
$pending = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = $post_id AND comment_approved = '0'" );
|
||||
return $pending;
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user