Prevent bulk actions from being performed when Filter button is clicked.

props jesin.
fixes #28555.
Built from https://develop.svn.wordpress.org/trunk@28916


git-svn-id: http://core.svn.wordpress.org/trunk@28715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-06-30 01:10:15 +00:00
parent c8adae8ec7
commit 5f0b156155
5 changed files with 7 additions and 4 deletions

View File

@ -258,7 +258,7 @@ class WP_Comments_List_Table extends WP_List_Table {
* @since 3.5.0
*/
do_action( 'restrict_manage_comments' );
submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {

View File

@ -69,7 +69,7 @@ class WP_Links_List_Table extends WP_List_Table {
'orderby' => 'name',
);
wp_dropdown_categories( $dropdown_options );
submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
?>
</div>
<?php

View File

@ -384,6 +384,9 @@ class WP_List_Table {
* @return string|bool The action name or False if no action was selected
*/
public function current_action() {
if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) )
return false;
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
return $_REQUEST['action'];

View File

@ -94,7 +94,7 @@ class WP_Media_List_Table extends WP_List_Table {
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
do_action( 'restrict_manage_posts' );
submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
if ( $this->detached ) {

View File

@ -233,7 +233,7 @@ class WP_Posts_List_Table extends WP_List_Table {
*/
do_action( 'restrict_manage_posts' );
submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) ) {