-
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
Query Pagination: Don't render an empty container #35092
Conversation
Size Change: +41 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
f60a349
to
ba98be8
Compare
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.
Thank you for working on this! It works as advertised — no container is rendered if pagination is empty.
I think this change requires block themes to update their templates if they reference the old query pagination markup. For example, tt1-blocks
: https://github.com/WordPress/theme-experiments/blob/master/tt1-blocks/block-templates/index.html#L51 — this wrapping div has to be removed for the container not to be rendered.
Should that be documented somewhere?
Hi, @jffng With deprecation in place, old templates shouldn't break, but I think the update would be good.
Not sure what would be the best place for this. I guess once FSE is stable, we will include similar changes in |
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.
Works well.
And I do not see any block validation errors or warnings with themes that still use the old markup.
Thanks for testing/reviews, @jffng and @carolinan. |
Description
Fixes #30522.
Alternative to #33635.
Updates Query Pagination block to use
render_callback
for rendering containerdiv
element. Render callback won't render anything if block content is empty.How has this been tested?
perPage
number so it shouldn't display pagination.perPage
once again, so now it renders paginations.Example Query
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).