Changeset 56185
- Timestamp:
- 07/10/2023 07:15:36 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/global-styles-and-settings.php
r56101 r56185 351 351 */ 352 352 function wp_theme_has_theme_json() { 353 static $theme_has_support = null; 353 static $theme_has_support = array(); 354 355 $stylesheet = get_stylesheet(); 354 356 355 357 if ( 356 null !== $theme_has_support&&358 isset( $theme_has_support[ $stylesheet ] ) && 357 359 /* 358 360 * Ignore static cache when the development mode is set to 'theme', to avoid interfering with 359 361 * the theme developer's workflow. 360 362 */ 361 wp_get_development_mode() !== 'theme' && 362 /* 363 * Ignore cache when automated test suites are running. Why? To ensure 364 * the static cache is reset between each test. 365 */ 366 ! ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) 363 wp_get_development_mode() !== 'theme' 367 364 ) { 368 return $theme_has_support ;365 return $theme_has_support[ $stylesheet ]; 369 366 } 370 367 … … 382 379 $path = apply_filters( 'theme_file_path', $path, 'theme.json' ); 383 380 384 $theme_has_support = file_exists( $path );385 386 return $theme_has_support ;381 $theme_has_support[ $stylesheet ] = file_exists( $path ); 382 383 return $theme_has_support[ $stylesheet ]; 387 384 } 388 385
Note: See TracChangeset
for help on using the changeset viewer.