-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
With the ongoing work on FSE (#24551) the Milestone:5 is about Query
block. The tracking issue for Query
block changes/enhancements is here: #24762.
This issue will be an overview for identifying and adding more options/parameters in Query
block.
The goal is to identify which parameters from WP_Query
and the REST API
can and will be supported from Query
block.
There will be definitely some work in REST API
to support some missing parameters and options if it makes sense and there are no blockers, like the orderby:rand
param that has performance issues . An example for needed missing support is order by
comments (comment_count
): #22002.
The below list is just the starting point for identifying the parameters to be supported and it will be finalised after discussions with everyone in the community about what parameters should eventually be supported. For now it contains items that are supported and/or make sense to me to be included. Feel free to share your thoughts and add/edit things to make this complete.
WP_Query reference: https://developer.wordpress.org/reference/classes/wp_query/
Posts API reference: https://developer.wordpress.org/rest-api/reference/posts/#list-posts
Supported from REST API
Argument:Option | Started | Completed |
---|---|---|
page |
✅ | |
per_page |
✅ | |
offset |
✅ | |
categories |
✅ | |
post_type |
✅ | ✅ |
order |
✅ | ✅ |
orderby:title |
✅ | ✅ |
orderby:date |
✅ | ✅ |
orderby:author |
🔲 | 🔲 |
orderby:parent |
🔲 | 🔲 |
orderby:modified |
🔲 | 🔲 |
tags_exclude |
🔲 | 🔲 |
categories_exclude |
🔲 | 🔲 |
before |
🔲 | 🔲 |
after |
🔲 | 🔲 |
author |
✅ | ✅ |
author_exclude |
🔲 | 🔲 |
sticky |
✅ | ✅ |
tax_relation |
🔲 | 🔲 |
include |
🔲 | 🔲 |
exclude |
🔲 | 🔲 |
NOT Supported from REST API
Argument:Option | Started | Completed |
---|---|---|
orderby:comment_count |
🔲 | 🔲 |
orderby:menu_order |
🔲 | 🔲 |
Prioritize
Argument:Option | Started | Completed |
---|---|---|
tags |
✅ | ✅ |
search |
✅ | ✅ |
Display options
We should also provide some different display options for the Query block itself and possible children Post blocks like PostTitle
, PostExcerpt
etc. to enable users to create a list of entities which is highly customizable. This would also allow us to have more block variations and patterns.
- Display entities as list or a grid in Query block. (Query block grid view #27067)
Query block design
Issue about the design is here: #25198