From 1b335ac3c9b2ef67718da0fe92fd2b6205e63278 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 15 Jul 2025 12:27:32 +0000 Subject: [PATCH] Coding Standards: Remove extra check in `wp_get_theme_data_template_parts()`. The `false === $metadata` check would always be true, as a non-false value causes an early return right before. To clarify this behavior, the needless priming of `$metadata = false` was removed as well, as there is no scenario where it will not be immediately overwritten. Follow-up to [56385]. Props justlevine. See #63268. Built from https://develop.svn.wordpress.org/trunk@60459 git-svn-id: http://core.svn.wordpress.org/trunk@59795 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/global-styles-and-settings.php | 9 +++------ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/wp-includes/global-styles-and-settings.php b/wp-includes/global-styles-and-settings.php index f308b50358..1ca81d4f08 100644 --- a/wp-includes/global-styles-and-settings.php +++ b/wp-includes/global-styles-and-settings.php @@ -483,7 +483,6 @@ function wp_get_theme_data_template_parts() { $cache_key = 'wp_get_theme_data_template_parts'; $can_use_cached = ! wp_is_development_mode( 'theme' ); - $metadata = false; if ( $can_use_cached ) { $metadata = wp_cache_get( $cache_key, $cache_group ); if ( false !== $metadata ) { @@ -491,11 +490,9 @@ function wp_get_theme_data_template_parts() { } } - if ( false === $metadata ) { - $metadata = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_template_parts(); - if ( $can_use_cached ) { - wp_cache_set( $cache_key, $metadata, $cache_group ); - } + $metadata = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_template_parts(); + if ( $can_use_cached ) { + wp_cache_set( $cache_key, $metadata, $cache_group ); } return $metadata; diff --git a/wp-includes/version.php b/wp-includes/version.php index c04206cf9a..b151b54ece 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60458'; +$wp_version = '6.9-alpha-60459'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.