Skip to content

Query block sticky posts needs "Ignore" option #66221

@coreyworrell

Description

@coreyworrell

Description

I'm filing this as a bug because it should have been implemented from the start to be on-par with WP_Query parameters. Currently there are options:

Include: default behavior where sticky posts are prepended to returned posts
Exclude: all sticky posts are excluded
Only: only sticky posts are included

There should be a final option:

Ignore: sticky posts are included in their natural order (basically as if they were not sticky)

This would simply set 'ignore_sticky_posts' => true in the query.

This is very useful for building a "Recent posts" list where we just want most recent regardless of sticky or not.

Reference: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/query/edit/inspector-controls/sticky-control.js

Step-by-step reproduction instructions

  1. Add Query Loop block
  2. Notice you cannot ignore sticky posts

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.6.2
  • Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Metadata

Metadata

Assignees

Labels

[Block] Query LoopAffects the Query Loop Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions