Template Loader: Make templates arg required#31671
Merged
Conversation
|
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
8a9bd46 to
d806bef
Compare
d806bef to
f25862b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #31652. Based on #31498 (which adds unit test coverage for
lib/full-site-editing/template-loader.php).Don't merge this PR before #31498!
In
gutenberg_override_query_template(), we used to allow for a missing$templatesargument (in which case it defaulted to an empty array), which was previously needed (when we were callinggutenberg_override_query_template()from another callsite that couldn't provide the template hierarchy as an argument). However, we don't need to allow for that case anymore, asgutenberg_override_query_template()is only ever called through the{type}_templatefilter, which always includes a$templatesargument.How has this been tested?
A unit test case that covers #31652 was added, and it passes. To verify locally: