-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Query Loop]: Properly initialize and update perPage
when we inherit from global query
#51641
[Query Loop]: Properly initialize and update perPage
when we inherit from global query
#51641
Conversation
…t from global query
Size Change: +54 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
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.
Not a code review
The correct number of posts is shown in the editor (minus the sticky post, which is a separate issue).
When switching "Inherit query from template" on and then off again, the items per page setting in the block toolbar is reset to the value that is added under Settings > Reading.
Flaky tests detected in 37de57e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5310338117
|
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.
It fixes the issue, and code looks good to me 👍
Thanks for fixing this so quickly 🙇 |
…t from global query (WordPress#51641)
What?
There are cases where themes are using
Query Loop
blocks that inherit from global query, but have also set the value of theirperPage
attribute(example 2023 theme). This has no effect in front-end, but at the editor side the logic preserves that value, that is not in sync with the respective reading setting.This PR always prioritizes the reading setting if we
inherit
and also properly updates the value if the reading setting is updated. This will be needed for #51223 too.Testing Instructions
per_page
reading setting is honored