-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Removal of "inherit query from template" breaks query loops in the site editor. #66790
Comments
Haha wow, I totally didn't realise that the setting had simply changed... must have been rushing... awesome 😅 And yeah renaming it like that is much better! Thanks |
No worries, glad everything is working properly! |
@ndiego chrome_Lq3LhUCcGN.mp4If you edit the header from single post or page template, you don't get that toggle. But if you edit it from an archive, or somewhere else, you do get it. Can you replicate? |
Yeah, I can. I believe this is because there's no query to inherit in a single post template, so that option was removed to reduce confusion. @richtabor is this accurate? |
Adding some thoughts here as I've been involved with trying to improve this block recently. This is intentional and it is meant to reduce confusion, but I understand that might not always be the case 😅 It was changed in #65067. The main reason was that with |
Thanks for the follow up - and for your work on on this :) I 100% agree, I always thought this is too technical for most users, and it was problematic when adding the block to a post and "inherit" was set to true by default... I did confuse myself as you can see though in my hurry and not realising this had also been renamed. I wonder if my follow up video should be made into a seperate issue - because when we're in an archive template, and edit the header, it shows the toggle, and we can set it to "default", but then when editing the header from another location the toggle dissapears and changes the value to "custom" (possibly without user interaction). I'm guessing it should always be hidden (or shown) when inside a header/footer as these would be used across multiple types of URLs (single/archive etc)? |
Yes good shout, I think this should be a separate issue. Great find too, that's something I never thought to test. Thank you!
My initial thoughts are that the option should always be hidden inside a header/footer, as there isn't anything to inherit in these cases, and these template parts should be handled independently to the type of template they're added to (e.g. archive). |
Description
It seems that the option "inherit query from template" is missing in 6.7.
From what I can see, the
inherit
attribute is still there though, and it looks like the logic is that its set totrue
in the site editor andfalse
in the block editor automatically.The problem is, we can use query loops in the site editor, that are not intended for archive display.
If I want to show a list of posts in header or footer template for example, this is now forced to be
true
, meaning it will be forced to connect to the global$wp_query
.I'm not sure if this breaks existing implementations, I assume it would as the attributes would be changed when visiting the site editor and the block attributes are upgraded automatically.
Step-by-step reproduction instructions
$wp_query
Screenshots, screen recording, code snippet
chrome_8IZ6zauWHY.mp4
Environment info
Same issue on both
6.7-alpha-59113
and nightly build6.7-RC3-59353
of WordPressPlease confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: