Make WordPress Core


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

Administration: Bring some consistency to handling list table view modes.

  • Remove duplicate variables and DocBlocks.
  • Add missing description for the $mode global.
  • Use sentence case for "Compact view" and "Extended view" labels.

Follow-up to [48398], [48423].

Props afercia, Offereins, SergeyBiryukov.
See #49715.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r48417 r48424  
    6262
    6363    /**
     64     * @global string   $mode                  List table view mode.
    6465     * @global WP_Query $wp_query              WordPress Query object.
    6566     * @global array    $post_mime_types
    6667     * @global array    $avail_post_mime_types
    67      * @global string   $mode
    6868     */
    6969    public function prepare_items() {
    70         global $wp_query, $post_mime_types, $avail_post_mime_types, $mode;
     70        global $mode, $wp_query, $post_mime_types, $avail_post_mime_types;
     71
     72        $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
    7173
    7274        // Exclude attachments scheduled for deletion in the next two hours
     
    9698
    9799        $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];
    98 
    99         $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
    100100
    101101        $this->set_pagination_args(
Note: See TracChangeset for help on using the changeset viewer.