Changeset 54184 for trunk/src/wp-includes/block-template-utils.php
- Timestamp:
- 09/15/2022 10:26:28 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template-utils.php
r54104 r54184 553 553 554 554 $theme = $terms[0]->name; 555 $ has_theme_file = wp_get_theme()->get_stylesheet() === $theme &&556 null !== _get_block_template_file( $post->post_type, $post->post_name );555 $template_file = _get_block_template_file( $post->post_type, $post->post_name ); 556 $has_theme_file = wp_get_theme()->get_stylesheet() === $theme && null !== $template_file; 557 557 558 558 $origin = get_post_meta( $post->ID, 'origin', true ); … … 574 574 $template->author = $post->post_author; 575 575 576 if ( 'wp_template' === $post->post_type && $has_theme_file && isset( $template_file['postTypes'] ) ) { 577 $template->post_types = $template_file['postTypes']; 578 } 579 576 580 if ( 'wp_template' === $post->post_type && isset( $default_template_types[ $template->slug ] ) ) { 577 581 $template->is_custom = false; … … 673 677 674 678 if ( $post_type && ! $template->is_custom ) { 679 continue; 680 } 681 682 if ( $post_type && 683 isset( $template->post_types ) && 684 ! in_array( $post_type, $template->post_types, true ) 685 ) { 675 686 continue; 676 687 }
Note: See TracChangeset
for help on using the changeset viewer.