-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Template activation: skip gutenberg_get_registered_block_templates query when no slugs are left to find #72795
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. |
Aljullu
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.
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.
Nice one! Tested with WP 6.8 + GB and warnings are gone!
With WP 6.9 beta 2 + GB they're still there (half less) but I assume it's because how compat works and both versions of activation (from beta and compat) run, right?
|
Yes, we will need to backport the PHP changes |
…ery when no slugs are left to find
2902e42 to
772ba3b
Compare
|
Thank you all! |
…ery when no slugs are left to find (#72795) Co-authored-by: ellatrix <[email protected]> Co-authored-by: Aljullu <[email protected]> Co-authored-by: kmanijak <[email protected]> Co-authored-by: bacoords <[email protected]>
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: ad996fb |
…ery when no slugs are left to find (#72795) Co-authored-by: ellatrix <[email protected]> Co-authored-by: Aljullu <[email protected]> Co-authored-by: kmanijak <[email protected]> Co-authored-by: bacoords <[email protected]>
|
I just cherry-picked this PR to the release/22.0 branch to get it included in the next release: 9704c13 |

What?
Closes #72786. Cc @bacoords.
When no slugs are left to find (because they were all found in the database), skip the registered templates query instead of calling it with
slug__inset to an empty array. This could confuse plugins in thinking they need to return all registered templates.Why?
Prevents the function that gets registered templates from returning all registered templates. If it returns templates that have slugs that were not requested, there will be PHP warnings.
How?
Check
$remaining_slugs.Testing Instructions
Install Woo. Create a front-page template in the site editor and set it active. The front page should have no PHP warnings.
Testing Instructions for Keyboard
Screenshots or screencast