-
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 block: Add option to ignore sticky posts behavior #69057
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @keithdevon. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +56 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
f35424e
to
fd5300e
Compare
Flaky tests detected in 04e6c1d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13173131309
|
if ( inherit ) { | ||
// Change the post-type if needed. | ||
if ( templateSlug?.startsWith( 'archive-' ) ) { | ||
query.postType = templateSlug.replace( 'archive-', '' ); | ||
postType = query.postType; | ||
currentPostType = query.postType; |
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.
Unrelated, this just fixes the ESLint warning.
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.
Thanks for testing, @carolinan 🙇
I read it as a general description of sticky posts. But yeah, it can be confusing. Do you think the help text should reflect the currently selected option? Maybe @afercia can recommend a better alternative. |
I was thinking more about this, and the help text seems okay. It describes how sticky posts generally work and isn't specific to the options; those hints are part of the options labels. |
What?
Closes #66221.
Alternative to #66222.
PR adds a new option for the Query block's sticky post setting: "Ignore," which doesn't prepend sticky posts at the top but displays them in the natural order of the query.
It's the same as setting
ignore_sticky_posts
totrue
forWP_Query
.Why?
Makes the Query block more consistent with the front end.
Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2025-02-05.at.20.19.47.mp4