Make WordPress Core

Changeset 48423


Ignore:
Timestamp:
07/10/2020 04:00:42 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r48398 r48423  
    12871287     */
    12881288    public function render_view_mode() {
     1289        global $mode;
     1290
    12891291        $screen = get_current_screen();
    12901292
     
    13121314        $mode = get_user_setting( 'posts_list_mode', 'list' );
    13131315
    1314         // Set 'list' as default value if $mode is not set.
    1315         $mode = ( isset( $mode ) && 'extended' === $mode ) ? 'extended' : 'list';
    1316 
    13171316        /**
    13181317         * Filters the current view mode.
     
    13201319         * @since 5.5.0
    13211320         *
    1322          * @param string $mode The current selected mode. Default value of
    1323          *                     posts_list_mode user setting.
     1321         * @param string $mode The current selected mode. Defaults to the value
     1322         *                     of 'posts_list_mode' user setting.
    13241323         */
    13251324        $mode = apply_filters( 'table_view_mode', $mode );
     
    13291328        ?>
    13301329        <fieldset class="metabox-prefs view-mode">
    1331         <legend><?php _e( 'View Mode' ); ?></legend>
     1330        <legend><?php _e( 'View mode' ); ?></legend>
    13321331                <label for="list-view-mode">
    13331332                    <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> />
     
    13361335                <label for="excerpt-view-mode">
    13371336                    <input id="excerpt-view-mode" type="radio" name="mode" value="extended" <?php checked( 'extended', $mode ); ?> />
    1338                     <?php _e( 'Extended View' ); ?>
     1337                    <?php _e( 'Extended view' ); ?>
    13391338                </label>
    13401339                <?php
Note: See TracChangeset for help on using the changeset viewer.