Template activation: call get_block_templates filter when short-circuiting#71840
Template activation: call get_block_templates filter when short-circuiting#71840
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
kmanijak
left a comment
There was a problem hiding this comment.
I confirm the hook is fired and so it's always called allowing plugins like WooCommerce to react on it and update templates. 🙌
e245cd9 to
4ea6042
Compare
|
Flaky tests detected in 4ea6042. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18170683104
|
4ea6042 to
098a18c
Compare
…iting (#71840) Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: kmanijak <karolmanijak@git.wordpress.org>
|
I just cherry-picked this PR to the release/21.8 branch to get it included in the next release: dc60d4e |
…iting (WordPress#71840) Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: kmanijak <karolmanijak@git.wordpress.org>
What?
Closes #71770
Why?
Some plugins expect
get_block_templatesto always be called, which no longer happens when we return a template throughpre_get_block_templates.How?
Run the
get_block_templatesfilter ourselves before returning the new template.Testing Instructions
Run this code to log when
get_block_templatesis called. For example, when activating a custom 404 template, it should still log a call with the 404 template, not just the index template.Testing Instructions for Keyboard
Screenshots or screencast