[wp-trac] [WordPress Trac] #42094: REST API: extend _fields parameter to selectively include nested fields in response JSON

WordPress Trac noreply at wordpress.org
Tue Sep 17 20:55:37 UTC 2019


#42094: REST API: extend _fields parameter to selectively include nested fields in
response JSON
-------------------------------------------------+-------------------------
 Reporter:  kadamwhite                           |       Owner:  kadamwhite
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.3
Component:  REST API                             |     Version:  4.9
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing has-unit-    |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by kadamwhite):

 * keywords:  has-patch dev-feedback needs-testing has-unit-tests => has-
     patch needs-testing has-unit-tests


Comment:

 I think an `idx`-style method is out of scope here, but I've refreshed the
 patch and extracted the utility into `rest_is_field_included`. I think it
 makes more sense here than in a list utilities context because it's both
 not strictly working from a list, and uses hierarchy logic that's specific
 to the REST API.

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


More information about the wp-trac mailing list