Opened 9 years ago
Last modified 9 years ago
#39972 new feature request
REST API: Allow querying posts by post format
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 4.7 |
| Component: | REST API | Keywords: | |
| Focuses: | rest-api | Cc: |
Description
Although it is listed in the REST API reference,
posts?format=video
shows all posts.
Change History (3)
#2
@
9 years ago
- Summary changed from REST API Post format=video to REST API: Allow querying posts by post format
- Type changed from defect (bug) to feature request
- Version changed from 4.7.2 to 4.7
Filtering by post format could be a nice enhancement, but as Ryan noted, this parameter is currently only supported for reading and editing individual posts. @sba7elfol can you give us some more information about your use case?
The WP_Query docs have an example of querying the post_format taxonomy - third example in the Taxonomy Parameters section.
Currently it would be possible to insert these extra query parameters in a plugin or theme using the 'rest_post_query' filter.
Note: See
TracTickets for help on using
tickets.
Which reference are you referring to? The reference on developer.wordpress.org doesn't appear to list this as a valid query parameter. While you can set it on a post, this is not the same as the collection query parameters.