Moves to the template loader hooks and functions into lib/compat folder#37149
Moves to the template loader hooks and functions into lib/compat folder#37149youknowriad merged 2 commits intotrunkfrom
Conversation
28797dc to
f5eba78
Compare
There was a problem hiding this comment.
I believe that function is useless and I can't find it on Core either. So either we remove it or backport it.
There was a problem hiding this comment.
@scruffian Is this something that is needed for universal themes? Should this be backported as render_block_template or something in Core?
There was a problem hiding this comment.
Seems to me like this has been obsolete since #28319 🤔
There was a problem hiding this comment.
Indeed 👍 I was confusing this with block_template_part which is used in hybrid themes.
27a4e55 to
708b641
Compare
| continue; | ||
| } | ||
| add_filter( str_replace( '-', '', $template_type ) . '_template', 'gutenberg_override_query_template', 20, 3 ); | ||
| add_filter( str_replace( '-', '', $template_type ) . '_template', 'gutenberg_locate_block_template', 20, 3 ); |
There was a problem hiding this comment.
just aligning function names with Core equivalents
ockham
left a comment
There was a problem hiding this comment.
Since we're moving template-canvas.php, I believe we also need to update this path:
diff --git a/lib/compat/wordpress-5.9/block-template.php b/lib/compat/wordpress-5.9/block-template.php
index 85b0a91b4e..4a57ece0d8 100644
--- a/lib/compat/wordpress-5.9/block-template.php
+++ b/lib/compat/wordpress-5.9/block-template.php
@@ -102,7 +102,7 @@ function gutenberg_locate_block_template( $template, $type, array $templates ) {
add_action( 'wp_head', 'gutenberg_render_title_tag', 1 ); // ...and make it unconditional.
// This file will be included instead of the theme's template file.
- return gutenberg_dir_path() . 'lib/template-canvas.php';
+ return gutenberg_dir_path() . 'lib/compat/wordpress-5.9/template-canvas.php';
}
/**708b641 to
c1ef717
Compare
|
@ockham good catch, I actually did that change but somehow it got lost before the commit. |
ockham
left a comment
There was a problem hiding this comment.
Thanks Riad, this LGTM now! 👍
(We might want to wait for confirmation for this question before merging.)
See #37141 for the reasoning here.