Query block: Add option to ignore sticky posts behavior#69057
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 ( templateSlug?.startsWith( 'archive-' ) ) { | ||
| query.postType = templateSlug.replace( 'archive-', '' ); | ||
| postType = query.postType; | ||
| currentPostType = query.postType; |
There was a problem hiding this comment.
Unrelated, this just fixes the ESLint warning.
|
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. |
) * Query block: Add option to ignore sticky posts behavior * Add backport changelog entry Unlinked contributors: keithdevon. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org> Co-authored-by: markhowellsmead <markhowellsmead@git.wordpress.org> Co-authored-by: coreyworrell <coreyw@git.wordpress.org>
) * Query block: Add option to ignore sticky posts behavior * Add backport changelog entry Unlinked contributors: keithdevon. Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org> Co-authored-by: markhowellsmead <markhowellsmead@git.wordpress.org> Co-authored-by: coreyworrell <coreyw@git.wordpress.org>

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_poststotrueforWP_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