-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Template activation: call get_block_templates filter when short-circuiting #71840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Co-authored-by: kmanijak <[email protected]>
|
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 <[email protected]> Co-authored-by: kmanijak <[email protected]>
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