[wp-trac] [WordPress Trac] #45099: REST API: Render only additional fields specific to request when _fields= is used

WordPress Trac noreply at wordpress.org
Wed Dec 12 20:50:26 UTC 2018


#45099: REST API: Render only additional fields specific to request when _fields=
is used
------------------------------------------------+--------------------------
 Reporter:  dlh                                 |       Owner:
                                                |  danielbachhuber
     Type:  defect (bug)                        |      Status:  closed
 Priority:  normal                              |   Milestone:  5.0
Component:  REST API                            |     Version:  4.9.8
 Severity:  normal                              |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests fixed-5.0  |     Focuses:  rest-api
------------------------------------------------+--------------------------
Changes (by desrosj):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"43986" 43986]:
 {{{
 #!CommitTicketReference repository="" revision="43986"
 REST API: Don't add fields to object when not included in `?_fields=`.

 In [43087], we improved REST API performance by only rendering the fields
 specified in the request. Similarly, any fields registered with
 `register_rest_field()` should only be rendered when included in
 `?_fields=`.

 Props dlh, danielbachhuber.

 Merges [43736] to trunk.

 Fixes #45099.
 }}}

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


More information about the wp-trac mailing list