Changeset 56931 for trunk/src/wp-includes/block-patterns.php
- Timestamp:
- 10/13/2023 04:44:09 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-patterns.php
r56771 r56931 351 351 } 352 352 353 $file_path = $dirpath . $file; 354 355 if ( ! file_exists( $file_path ) ) { 356 _doing_it_wrong( 357 __FUNCTION__, 358 sprintf( 359 /* translators: %s: file name. */ 360 __( 'Could not register file "%s" as a block pattern as the file does not exist.' ), 361 $file 362 ), 363 '6.4.0' 364 ); 365 $theme->delete_pattern_cache(); 366 continue; 367 } 368 353 369 // The actual pattern content is the output of the file. 354 370 ob_start(); 355 include $ dirpath . $file;371 include $file_path; 356 372 $pattern_data['content'] = ob_get_clean(); 357 373 if ( ! $pattern_data['content'] ) { … … 409 425 $can_use_cached = ! wp_is_development_mode( 'theme' ); 410 426 411 if ( $can_use_cached ) {412 $pattern_data = $theme->get_pattern_cache();413 if ( is_array( $pattern_data )) {427 $pattern_data = $theme->get_pattern_cache(); 428 if ( is_array( $pattern_data ) ) { 429 if ( $can_use_cached ) { 414 430 return $pattern_data; 415 431 } 432 // If in development mode, clear pattern cache. 433 $theme->delete_pattern_cache(); 416 434 } 417 435
Note: See TracChangeset
for help on using the changeset viewer.