From fafbd9fafd5f096e1b4b0dd794fa6bfaabb23826 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 17 Feb 2016 21:59:51 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/class-wp-ms-sites-list-table.php | 7 ++++++- src/wp-admin/includes/class-wp-ms-users-list-table.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-ms-sites-list-table.php b/src/wp-admin/includes/class-wp-ms-sites-list-table.php index 34436a7518..ff9736f40e 100644 --- a/src/wp-admin/includes/class-wp-ms-sites-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-sites-list-table.php @@ -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' ); diff --git a/src/wp-admin/includes/class-wp-ms-users-list-table.php b/src/wp-admin/includes/class-wp-ms-users-list-table.php index e94081f4c8..4b8e8fc8eb 100644 --- a/src/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-users-list-table.php @@ -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 );