[wp-trac] [WordPress Trac] #39972: REST API: Allow querying posts by post format (was: REST API Post format=video)

WordPress Trac noreply at wordpress.org
Mon Feb 27 05:52:38 UTC 2017


#39972: REST API: Allow querying posts by post format
-----------------------------+------------------------------
 Reporter:  sba7elfol        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  REST API         |     Version:  4.7
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  rest-api
-----------------------------+------------------------------
Changes (by jnylen0):

 * version:  4.7.2 => 4.7
 * type:  defect (bug) => feature request


Comment:

 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
 [https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
 Taxonomy Parameters section].

 Currently it would be possible to insert these extra query parameters in a
 plugin or theme using the
 [https://core.trac.wordpress.org/browser/tags/4.7.2/src/wp-includes/rest-
 api/endpoints/class-wp-rest-posts-controller.php#L252 'rest_post_query'
 filter].

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39972#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list