From 0f92086ca0f087c7189473af624793549a6582e9 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 10 Jul 2020 16:02:05 +0000 Subject: [PATCH] Administration: Make some adjustments to `WP_Screen::render_view_mode()`: * Restore the `$mode` global for backward compatibility. * Remove redundant check, as `$mode` is already set at this point, and already defaults to `list` via `get_user_setting()`'s second argument. * Use sentence case for "View mode" and "Extended view" labels. Follow-up to [48398]. See #49715. Built from https://develop.svn.wordpress.org/trunk@48423 git-svn-id: http://core.svn.wordpress.org/trunk@48192 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-screen.php | 13 ++++++------- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php index dace397437..3b32162b3f 100644 --- a/wp-admin/includes/class-wp-screen.php +++ b/wp-admin/includes/class-wp-screen.php @@ -1286,6 +1286,8 @@ final class WP_Screen { * @global string $mode List table view mode. */ public function render_view_mode() { + global $mode; + $screen = get_current_screen(); // Currently only enabled for posts and comments lists. @@ -1311,16 +1313,13 @@ final class WP_Screen { $mode = get_user_setting( 'posts_list_mode', 'list' ); - // Set 'list' as default value if $mode is not set. - $mode = ( isset( $mode ) && 'extended' === $mode ) ? 'extended' : 'list'; - /** * Filters the current view mode. * * @since 5.5.0 * - * @param string $mode The current selected mode. Default value of - * posts_list_mode user setting. + * @param string $mode The current selected mode. Defaults to the value + * of 'posts_list_mode' user setting. */ $mode = apply_filters( 'table_view_mode', $mode ); @@ -1328,14 +1327,14 @@ final class WP_Screen { add_filter( 'screen_options_show_submit', '__return_true' ); ?>
- +