Changeset 58323 for trunk/src/wp-includes/block-template-utils.php
- Timestamp:
- 06/04/2024 08:13:01 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template-utils.php
r58291 r58323 361 361 if ( 'wp_template' !== $template_type && 'wp_template_part' !== $template_type ) { 362 362 return null; 363 } 364 365 $default_template_types = array(); 366 if ( 'wp_template' === $template_type ) { 367 $default_template_types = get_default_block_template_types(); 363 368 } 364 369 … … 426 431 if ( 'wp_template' === $template_type ) { 427 432 $candidate = _add_block_template_info( $new_template_item ); 433 $is_custom = ! isset( $default_template_types[ $candidate['slug'] ] ); 434 428 435 if ( 429 436 ! $post_type || 430 437 ( $post_type && isset( $candidate['postTypes'] ) && in_array( $post_type, $candidate['postTypes'], true ) ) 431 438 ) { 439 $template_files[ $template_slug ] = $candidate; 440 } 441 442 // The custom templates with no associated post types are available for all post types. 443 if ( $post_type && ! isset( $candidate['postTypes'] ) && $is_custom ) { 432 444 $template_files[ $template_slug ] = $candidate; 433 445 }
Note: See TracChangeset
for help on using the changeset viewer.