diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index c78c66678..50139a1bc 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -190,6 +190,16 @@ $start = $offset = ( $page - 1 ) * $comments_per_page; list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra +$_comment_post_ids = array(); +foreach ( $_comments as $_c ) { + $_comment_post_ids[] = $_c->comment_post_ID; +} +$_comment_pending_count_temp = (array) get_pending_comments_num($_comment_post_ids); +foreach ( (array) $_comment_post_ids as $_cpid ) + $_comment_pending_count[$_cpid] = isset( $_comment_pending_count_temp[$_cpid] ) ? $_comment_pending_count_temp[$_cpid] : 0; +if ( empty($_comment_pending_count) ) + $_comment_pending_count = array(); + $comments = array_slice($_comments, 0, $comments_per_page); $extra_comments = array_slice($_comments, $comments_per_page); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 436988bdc..36d0b253e 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1944,18 +1944,11 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 * @param unknown_type $checkbox */ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) { - global $comment, $post; + global $comment, $post, $_comment_pending_count; $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID); $the_comment_status = wp_get_comment_status($comment->comment_ID); - if ( current_user_can( 'edit_post', $post->ID ) ) { - $post_link = ""; - $post_link .= get_the_title($comment->comment_post_ID) . ''; - } else { - $post_link = get_the_title($comment->comment_post_ID); - } - $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) $author_url = ''; @@ -1971,10 +1964,10 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, else $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date ); - $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); - $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); - $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); - $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); + $delete_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); + $approve_url = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) ); + $unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) ); + $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$post->ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); echo "