Multisite: Make view mode sticky for network users and sites list tables.
Fixes #34365. git-svn-id: https://develop.svn.wordpress.org/trunk@36562 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e198e92dff
commit
fafbd9fafd
|
@ -69,7 +69,12 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
|
|||
|
||||
$current_site = get_current_site();
|
||||
|
||||
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
|
||||
if ( ! empty( $_REQUEST['mode'] ) ) {
|
||||
$mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
|
||||
set_user_setting ( 'sites_list_mode', $mode );
|
||||
} else {
|
||||
$mode = get_user_setting ( 'sites_list_mode', 'list' );
|
||||
}
|
||||
|
||||
$per_page = $this->get_items_per_page( 'sites_network_per_page' );
|
||||
|
||||
|
|
|
@ -81,7 +81,12 @@ class WP_MS_Users_List_Table extends WP_List_Table {
|
|||
if ( isset( $_REQUEST['order'] ) )
|
||||
$args['order'] = $_REQUEST['order'];
|
||||
|
||||
$mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
|
||||
if ( ! empty( $_REQUEST['mode'] ) ) {
|
||||
$mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
|
||||
set_user_setting ( 'network_users_list_mode', $mode );
|
||||
} else {
|
||||
$mode = get_user_setting ( 'network_users_list_mode', 'list' );
|
||||
}
|
||||
|
||||
/** This filter is documented in wp-admin/includes/class-wp-users-list-table.php */
|
||||
$args = apply_filters( 'users_list_table_query_args', $args );
|
||||
|
|
Loading…
Reference in New Issue