Fix Comments meta box in post editing screen. See #14579
git-svn-id: https://develop.svn.wordpress.org/trunk@15497 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
37401689c5
commit
9805f3a4b0
|
@ -627,17 +627,16 @@ case 'add-comment' :
|
||||||
|
|
||||||
require_once( './includes/default-list-tables.php' );
|
require_once( './includes/default-list-tables.php' );
|
||||||
$table = new WP_Comments_Table();
|
$table = new WP_Comments_Table();
|
||||||
|
$table->prepare_items();
|
||||||
|
|
||||||
global $comments;
|
if ( !$table->has_items() )
|
||||||
|
|
||||||
if ( !$comments )
|
|
||||||
die('1');
|
die('1');
|
||||||
|
|
||||||
if ( get_option('show_avatars') )
|
if ( get_option('show_avatars') )
|
||||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||||
|
|
||||||
$x = new WP_Ajax_Response();
|
$x = new WP_Ajax_Response();
|
||||||
foreach ( (array) $comments as $comment ) {
|
foreach ( $table->items as $comment ) {
|
||||||
get_comment( $comment );
|
get_comment( $comment );
|
||||||
ob_start();
|
ob_start();
|
||||||
$table->single_row( $comment->comment_ID, $mode, $status, true, true );
|
$table->single_row( $comment->comment_ID, $mode, $status, true, true );
|
||||||
|
@ -660,15 +659,14 @@ case 'get-comments' :
|
||||||
|
|
||||||
require_once( './includes/default-list-tables.php' );
|
require_once( './includes/default-list-tables.php' );
|
||||||
$table = new WP_Comments_Table();
|
$table = new WP_Comments_Table();
|
||||||
|
$table->prepare_items();
|
||||||
|
|
||||||
global $comments;
|
if ( !$table->has_items() )
|
||||||
|
|
||||||
if ( !$comments )
|
|
||||||
die('1');
|
die('1');
|
||||||
|
|
||||||
$comment_list_item = '';
|
$comment_list_item = '';
|
||||||
$x = new WP_Ajax_Response();
|
$x = new WP_Ajax_Response();
|
||||||
foreach ( (array) $comments as $comment ) {
|
foreach ( $table->items as $comment ) {
|
||||||
get_comment( $comment );
|
get_comment( $comment );
|
||||||
ob_start();
|
ob_start();
|
||||||
$table->single_row( $comment->comment_ID, 'single', false, false );
|
$table->single_row( $comment->comment_ID, 'single', false, false );
|
||||||
|
|
|
@ -2111,7 +2111,7 @@ class WP_Comments_Table extends WP_List_Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepare_items() {
|
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;
|
$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 );
|
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_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;">
|
<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
<?php print_column_headers('edit-comments'); ?>
|
<?php $table->print_column_headers(); ?>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody id="the-comment-list" class="list:comment"></tbody>
|
<tbody id="the-comment-list" class="list:comment"></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue