mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Fix Comments meta box in post editing screen. See #14579
git-svn-id: http://svn.automattic.com/wordpress/trunk@15497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c6056827ed
commit
b921471dea
@ -627,17 +627,16 @@ case 'add-comment' :
|
||||
|
||||
require_once( './includes/default-list-tables.php' );
|
||||
$table = new WP_Comments_Table();
|
||||
$table->prepare_items();
|
||||
|
||||
global $comments;
|
||||
|
||||
if ( !$comments )
|
||||
if ( !$table->has_items() )
|
||||
die('1');
|
||||
|
||||
if ( get_option('show_avatars') )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( (array) $comments as $comment ) {
|
||||
foreach ( $table->items as $comment ) {
|
||||
get_comment( $comment );
|
||||
ob_start();
|
||||
$table->single_row( $comment->comment_ID, $mode, $status, true, true );
|
||||
@ -660,15 +659,14 @@ case 'get-comments' :
|
||||
|
||||
require_once( './includes/default-list-tables.php' );
|
||||
$table = new WP_Comments_Table();
|
||||
$table->prepare_items();
|
||||
|
||||
global $comments;
|
||||
|
||||
if ( !$comments )
|
||||
if ( !$table->has_items() )
|
||||
die('1');
|
||||
|
||||
$comment_list_item = '';
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( (array) $comments as $comment ) {
|
||||
foreach ( $table->items as $comment ) {
|
||||
get_comment( $comment );
|
||||
ob_start();
|
||||
$table->single_row( $comment->comment_ID, 'single', false, false );
|
||||
|
@ -2111,7 +2111,7 @@ class WP_Comments_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
function prepare_items() {
|
||||
global $comments, $extra_comments, $total_comments, $post_id, $comment_status, $mode;
|
||||
global $post_id, $comment_status, $mode;
|
||||
|
||||
$post_id = isset( $_REQUEST['post_ID'] ) ? absint( $_REQUEST['post_ID'] ) : 0;
|
||||
|
||||
|
@ -460,11 +460,15 @@ function post_comment_meta_box($post) {
|
||||
|
||||
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
|
||||
add_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead', 8, 1);
|
||||
add_filter('manage_edit-comments_sortable_columns', create_function('', 'return array();'), 8);
|
||||
|
||||
require_once( './includes/default-list-tables.php' );
|
||||
$table = new WP_Comments_Table;
|
||||
?>
|
||||
|
||||
<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
|
||||
<thead><tr>
|
||||
<?php print_column_headers('edit-comments'); ?>
|
||||
<?php $table->print_column_headers(); ?>
|
||||
</tr></thead>
|
||||
<tbody id="the-comment-list" class="list:comment"></tbody>
|
||||
</table>
|
||||
|
Loading…
x
Reference in New Issue
Block a user