-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Patterns, Templates: Try conditional theme
attribute injection
#5514
base: trunk
Are you sure you want to change the base?
Patterns, Templates: Try conditional theme
attribute injection
#5514
Conversation
…locks." This reverts commit dcd6e5c.
cc/ @gziolo @felixarntz |
Thanks for the ping @ockham. Do we know why the revert in #5509 fixed the problem? Why did the |
I haven't had a chance to have a closer look, but it would be my understanding that this check won't work with the preloading feature. I'm wondering if it would be possible to create a helper function like However, I believe that in this case, @ockham is planning to move the necessary computation to the REST API handler which will remove the need for using this check altogether. |
Yeah, my best guess is that |
BTW if that's indeed the reason, it raises the question why we're not setting It seems like we'd like to mimic a REST API request context as closely as possible when preloading routes (not just in this case, but for all routes really 🤔 ) |
Ah nevermind, can't redefine a constant. Fair enough 😬 |
@ockham That's why there is this ticket: https://core.trac.wordpress.org/ticket/42061 If it was moving forward, it would allow us to more properly test REST API specific logic, as there would be a filter to use instead of being limited to the constant. |
Ah, TIL! Thank you for the pointer :)
👍 |
Not planning to land this for 6.4, it's been too much of a 🎢
WIP, early stages.
Since we had to revert our previous attempt at this, I'm starting a new draft PR based on the notes I posted here.
TODO:
WP_Block_Patterns_Registry
render_block
.REST_REQUEST
conditionals), it's probably enough to add unit test coverage for those controllersWhen testing, make sure that this doesn't cause this regression (it currently still does; needs more tweaking!)
Trac ticket: TBD
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.