Commit 88d1e36a authored by Sergey Biryukov's avatar Sergey Biryukov
Browse files

Administration: Don't override the `$mode` global in...

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.
Built from https://develop.svn.wordpress.org/trunk@48670


git-svn-id: https://core.svn.wordpress.org/trunk@48432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 1d2d4603
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -78,17 +78,20 @@ class WP_Comments_List_Table extends WP_List_Table {
	}

	/**
	 * @global string $mode           List table view mode.
	 * @global int    $post_id
	 * @global string $comment_status
	 * @global string $comment_type
	 * @global string $search
	 */
	public function prepare_items() {
		global $post_id, $comment_status, $comment_type, $search;
		global $mode, $post_id, $comment_status, $comment_type, $search;

		if ( ! empty( $_REQUEST['mode'] ) ) {
			$mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
			set_user_setting( 'posts_list_mode', $mode );
		} else {
			$mode = get_user_setting( 'posts_list_mode', 'list' );
		}

		$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
+3 −1
Original line number Diff line number Diff line
@@ -1313,7 +1313,9 @@ final class WP_Screen {
			return;
		}

		if ( ! isset( $mode ) ) {
			$mode = get_user_setting( 'posts_list_mode', 'list' );
		}

		// This needs a submit button.
		add_filter( 'screen_options_show_submit', '__return_true' );
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
 *
 * @global string $wp_version
 */
$wp_version = '5.5-beta4-48669';
$wp_version = '5.5-beta4-48670';

/**
 * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.