From cd7618399e75f1ae7a00b222ab4d93be0cfc15a7 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 17 Jun 2014 22:17:14 +0000 Subject: [PATCH] Prevent bulk actions from being performed when Filter button is clicked. props layotte. fixes #28555. Built from https://develop.svn.wordpress.org/trunk@28766 git-svn-id: http://core.svn.wordpress.org/trunk@28579 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 76f25e0931..18f87fc0c1 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -371,7 +371,7 @@ class WP_List_Table { echo "\n"; - submit_button( __( 'Apply' ), 'action', false, false, array( 'id' => "doaction$two" ) ); + submit_button( __( 'Apply' ), 'action', 'bulk_action', false, array( 'id' => "doaction$two" ) ); echo "\n"; } @@ -384,11 +384,18 @@ class WP_List_Table { * @return string|bool The action name or False if no action was selected */ public function current_action() { - if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) - return $_REQUEST['action']; + if ( ! empty( $_REQUEST['bulk_action'] ) ) { - if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) - return $_REQUEST['action2']; + // Bulk Actions drop-down above the list table. + if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) { + return $_REQUEST['action']; + } + + // Bulk Actions drop-down below the list table. + if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) { + return $_REQUEST['action2']; + } + } return false; }