From 9d55418f4d036c1efdec5f27005dde984786b3f2 Mon Sep 17 00:00:00 2001 From: Jonny Harris Date: Mon, 19 Jun 2023 14:18:53 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: George Mamadashvili --- packages/block-library/src/template-part/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/template-part/index.php b/packages/block-library/src/template-part/index.php index 09b1664723419f..84e3a985ec4410 100644 --- a/packages/block-library/src/template-part/index.php +++ b/packages/block-library/src/template-part/index.php @@ -75,7 +75,7 @@ function render_block_core_template_part( $attributes ) { foreach ( $themes as $theme ) { $theme_folders = get_block_theme_folders( $theme ); - $template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $theme_folders['slug'] . '.html' ); + $template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' ); if ( file_exists( $template_part_file_path ) ) { $content = (string) file_get_contents( $template_part_file_path ); $content = '' !== $content ? _inject_theme_attribute_in_block_template_content( $content ) : '';