From 1b4603a6115b6a8e77e961c28b35e249decd566e Mon Sep 17 00:00:00 2001 From: scribu Date: Wed, 18 Aug 2010 22:26:22 +0000 Subject: [PATCH] Fix the Trash quickling in edit-comments.php. See #14637 git-svn-id: https://develop.svn.wordpress.org/trunk@15508 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 2 +- wp-admin/edit-comments.php | 10 +++++----- wp-admin/includes/default-list-tables.php | 6 +++--- wp-admin/includes/list-table.php | 16 ++++++++++++++++ wp-admin/js/edit-comments.dev.js | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 75e02feb20..ea0aef681b 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -639,7 +639,7 @@ case 'add-comment' : foreach ( $table->items as $comment ) { get_comment( $comment ); ob_start(); - $table->single_row( $comment->comment_ID, $mode, $status, true, true ); + $table->single_row( $comment->comment_ID, $mode, $comment_status, true, true ); $comment_list_item = ob_get_contents(); ob_end_clean(); $x->add( array( diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index bed8d9479f..4b49a7da14 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -257,9 +257,9 @@ unset($status_links); - - - + + + @@ -278,8 +278,8 @@ unset($status_links); - - + + diff --git a/wp-admin/includes/default-list-tables.php b/wp-admin/includes/default-list-tables.php index 1a326d74f8..1884ee5d44 100644 --- a/wp-admin/includes/default-list-tables.php +++ b/wp-admin/includes/default-list-tables.php @@ -1941,7 +1941,7 @@ class WP_Comments_Table extends WP_List_Table { } function prepare_items() { - global $post_id, $comment_status, $mode; + global $post_id, $comment_status, $mode, $search; $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0; @@ -1955,8 +1955,8 @@ class WP_Comments_Table extends WP_List_Table { $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : ''; - if ( isset( $_POST['num'] ) ) - $comments_per_page = $_POST['num']; + if ( isset( $_POST['per_page'] ) ) + $comments_per_page = $_POST['per_page']; else $comments_per_page = (int) get_user_option( 'edit_comments_per_page' ); diff --git a/wp-admin/includes/list-table.php b/wp-admin/includes/list-table.php index ce681c8346..7c49237f51 100644 --- a/wp-admin/includes/list-table.php +++ b/wp-admin/includes/list-table.php @@ -135,6 +135,22 @@ class WP_List_Table { $this->_pagination_args = $args; } + /** + * Access the pagination args + * + * @since 3.1.0 + * @access public + * + * @param string $key + * @return array + */ + function get_pagination_arg( $key ) { + if ( 'page' == $key ) + return $this->get_pagenum(); + + return @$this->_pagination_args[ $key ]; + } + /** * Wether the table has items to display or not * diff --git a/wp-admin/js/edit-comments.dev.js b/wp-admin/js/edit-comments.dev.js index 03beb8ad02..bec6f3ccce 100644 --- a/wp-admin/js/edit-comments.dev.js +++ b/wp-admin/js/edit-comments.dev.js @@ -209,7 +209,7 @@ setCommentsList = function() { } theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); -// $('#get-extra-comments').submit(); See http://core.trac.wordpress.org/ticket/14637 + $('#get-extra-comments').submit(); }; theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );