[wp-trac] [WordPress Trac] #38580: REST API: Fix querying multiple post statuses at once

WordPress Trac noreply at wordpress.org
Sun Oct 30 23:23:13 UTC 2016


#38580: REST API: Fix querying multiple post statuses at once
--------------------------+-----------------------------
 Reporter:  jnylen0       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Currently the description of the `status` parameter on the post listing
 endpoint is as follows:

 > Limit result set to posts assigned a specific status; can be comma-
 delimited list of status types.

 Passing a comma-delimited list of status types is broken in trunk due to
 the additional validation introduced in [38911].  This patch fixes the
 issue and adds a couple of tests.

 This patch also allows an array of post statuses to be passed, to make
 `status` more consistent with other similar arguments.

 Questions:

 - I've set `status` to an `array` type in the schema.  Does this make
 sense given that there is an `enum` value present in the schema also?
 - I don't think we need to validate the `publish` status like what was
 done in https://github.com/danielbachhuber/wordpress-
 develop/pull/4/commits/51de903 since it is always whitelisted.  Can
 someone confirm?
 - Right now there is both a `validate_callback` and a `sanitize_callback`,
 which means we need to call `wp_parse_slug_list` twice.  Should we move
 all of this logic into `sanitize_callback` instead?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38580>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list