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

WordPress Trac noreply at wordpress.org
Wed Sep 18 22:41:47 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                                          |
-------------------------------------------------+-------------------------

Comment (by dlh):

 I haven't been able to look at this patch in too much depth, but one small
 thing I noticed is that I think the `$permalink_template_requested` and
 `$generated_slug_requested` variables could be set using
 `rest_is_field_included()`, rather than calling `if ( $var &&
 rest_is_field_included() )`. Both of those variables are currently set
 using the `in_array()` checks that are replaced elsewhere in the patch
 with `rest_is_field_included()`.

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


More information about the wp-trac mailing list