Introduce WP_List_Table::current_action() and use throughout admin list screens. See #14579

git-svn-id: http://svn.automattic.com/wordpress/trunk@15642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
scribu
2010-09-22 00:10:39 +00:00
parent f3d45472d2
commit e975e650cf
9 changed files with 155 additions and 105 deletions

View File

@@ -215,6 +215,13 @@ class WP_Posts_Table extends WP_List_Table {
}
}
function current_action() {
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
return 'delete_all';
return parent::current_action();
}
function pagination( $which ) {
global $post_type_object, $mode;
@@ -1080,6 +1087,19 @@ class WP_Media_Table extends WP_List_Table {
<?php
}
function current_action() {
if ( isset( $_REQUEST['find_detached'] ) )
return 'find_detached';
if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) )
return 'attach';
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
return 'delete_all';
return parent::current_action();
}
function has_items() {
return have_posts();
}
@@ -1482,6 +1502,13 @@ class WP_Terms_Table extends WP_List_Table {
return $actions;
}
function current_action() {
if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] || 'delete' == $_REQUEST['action2'] ) )
return 'bulk-delete';
return parent::current_action();
}
function get_columns() {
global $taxonomy;
@@ -1861,6 +1888,13 @@ class WP_Users_Table extends WP_List_Table {
</div>
<?php
}
function current_action() {
if ( isset($_REQUEST['changeit']) && !empty($_REQUEST['new_role']) )
return 'promote';
return parent::current_action();
}
function get_columns() {
return array(
@@ -2214,6 +2248,13 @@ class WP_Comments_Table extends WP_List_Table {
echo '</div>';
}
function current_action() {
if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
return 'delete_all';
return parent::current_action();
}
function get_columns() {
global $mode;
@@ -3458,6 +3499,13 @@ class WP_Plugins_Table extends WP_List_Table {
<?php }
}
function current_action() {
if ( isset($_POST['clear-recent-list']) )
return 'clear-recent-list';
return parent::current_action();
}
function display_rows() {
global $status, $page;