From b47a138372e477ab1805f3f4e20beac244cd95ea Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Mar 2024 18:07:15 +0000 Subject: [PATCH] Upload: Move an assignment in `wp-admin/upload.php` into a conditional branch. This is a micro-optimization to reduce unnecessary memory allocation. Follow-up to [28682]. Props mujuonly, swissspidy, mukesh27. Fixes #60683. Built from https://develop.svn.wordpress.org/trunk@57796 git-svn-id: http://core.svn.wordpress.org/trunk@57297 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 3c48cc9476..8267ad50be 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -128,12 +128,13 @@ if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message' ), $_SERVER['REQUEST_URI'] ); } -$mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid'; $modes = array( 'grid', 'list' ); if ( isset( $_GET['mode'] ) && in_array( $_GET['mode'], $modes, true ) ) { $mode = $_GET['mode']; update_user_option( get_current_user_id(), 'media_library_mode', $mode ); +} else { + $mode = get_user_option( 'media_library_mode', get_current_user_id() ) ? get_user_option( 'media_library_mode', get_current_user_id() ) : 'grid'; } if ( 'grid' === $mode ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 8097b8f7a6..73a06be9a1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-57795'; +$wp_version = '6.6-alpha-57796'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.