-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fix all posts showing when no posts are sticky #4144
Conversation
This fixes the issue where all non-sticky posts show up in the Query Loop block when Sticky Posts is set to "Only" and there are no sticky posts. Additional `(array)` typecast for safety. See https://core.trac.wordpress.org/ticket/57822
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.
This bug has always irked me :)
We probably should add a test for this for the query loop block |
Co-authored-by: Dominik Schilling <dominikschilling+git@gmail.com>
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.
Looks good, thank you!
Commits 526d9b1 and 2164f1f bring full parity with the changes in Gutenberg https://github.com/WordPress/gutenberg/blob/42dad571eac32c41a7ff34f0da80fcc4e5ceb3bd/lib/compat/wordpress-6.1/blocks.php#L171-L183 to synchronize Core and Gutenberg. |
Just for reference, the function will be under So some links for GB in comments would be different. |
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.
- Confirmed the changes match the changes in Gutenberg ✅
- Test Report confirms this PR fixes the reported issue ✅
Ready for commit 👍
Committed via https://core.trac.wordpress.org/changeset/55447. |
This fixes the issue where all non-sticky posts show up in the Query Loop block when Sticky Posts is set to "Only" and there are no sticky posts.
Additional
(array)
typecast for safety.See https://core.trac.wordpress.org/ticket/57822
Trac ticket:
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.