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
This commit is contained in:
Sergey Biryukov 2014-06-17 22:17:14 +00:00
parent f1a15dd4fe
commit cd7618399e
1 changed files with 12 additions and 5 deletions

View File

@ -371,7 +371,7 @@ class WP_List_Table {
echo "</select>\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'] )
// 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;
}