Make WordPress Core


Ignore:
Timestamp:
07/28/2020 04:53:03 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Administration: Don't override the $mode global in WP_Screen::render_view_mode() if it's already set.

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

See #49715.

File:
1 edited

Legend:

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

    r48594 r48670  
    7979
    8080    /**
     81     * @global string $mode           List table view mode.
    8182     * @global int    $post_id
    8283     * @global string $comment_status
     
    8586     */
    8687    public function prepare_items() {
    87         global $post_id, $comment_status, $comment_type, $search;
     88        global $mode, $post_id, $comment_status, $comment_type, $search;
    8889
    8990        if ( ! empty( $_REQUEST['mode'] ) ) {
    9091            $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
    9192            set_user_setting( 'posts_list_mode', $mode );
     93        } else {
     94            $mode = get_user_setting( 'posts_list_mode', 'list' );
    9295        }
    9396
Note: See TracChangeset for help on using the changeset viewer.