From 2528cfabf30b39b85f925c7650a15d137f38cad7 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 13 May 2020 19:56:18 +0200 Subject: [PATCH] Fix current template retrieval during render --- lib/template-loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/template-loader.php b/lib/template-loader.php index c0be22bc759571..f729fe437be5cc 100644 --- a/lib/template-loader.php +++ b/lib/template-loader.php @@ -93,7 +93,7 @@ function get_template_hierachy( $template_type ) { function gutenberg_override_query_template( $template, $type, array $templates = array() ) { global $_wp_current_template_id, $_wp_current_template_content; - $current_template = gutenberg_find_template_post_and_parts( basename( $template, '.php' ), $templates ); + $current_template = gutenberg_find_template_post_and_parts( $type, $templates ); if ( $current_template ) { $_wp_current_template_id = $current_template['template_post']->ID;