Changeset 52364 for trunk/src/wp-includes/blocks/template-part.php
- Timestamp:
- 12/14/2021 01:55:28 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/template-part.php
r52324 r52364 65 65 // Else, if the template part was provided by the active theme, 66 66 // render the corresponding file content. 67 $theme_folders = get_block_theme_folders(); 68 $template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' ); 67 $parent_theme_folders = get_block_theme_folders( get_template() ); 68 $child_theme_folders = get_block_theme_folders( get_stylesheet() ); 69 $child_theme_part_file_path = get_theme_file_path( '/' . $child_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' ); 70 $parent_theme_part_file_path = get_theme_file_path( '/' . $parent_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' ); 71 $template_part_file_path = 0 === validate_file( $attributes['slug'] ) && file_exists( $child_theme_part_file_path ) ? $child_theme_part_file_path : $parent_theme_part_file_path; 69 72 if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) { 70 73 $content = file_get_contents( $template_part_file_path );
Note: See TracChangeset
for help on using the changeset viewer.