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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user