[wp-trac] [WordPress Trac] #38131: REST API: Provide interface to include or exclude specific fields from response JSON

WordPress Trac noreply at wordpress.org
Wed Oct 4 18:44:43 UTC 2017


#38131: REST API: Provide interface to include or exclude specific fields from
response JSON
---------------------------------------------+--------------------------
 Reporter:  kadamwhite                       |       Owner:  kadamwhite
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  4.9
Component:  REST API                         |     Version:  4.4
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  commit has-unit-tests has-patch  |     Focuses:  performance
---------------------------------------------+--------------------------
Changes (by kadamwhite):

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


Comment:

 In [changeset:"41744"]:
 {{{
 #!CommitTicketReference repository="" revision="41744"
 REST API: Add _fields parameter to selectively include fields in response
 JSON.

 Allows REST API consumers to specify the specific fields needed in their
 application code, whitelisting those fields and omitting all others from
 the returned JSON response object.
 This permits applications that only need for example the ID and title of
 posts to avoid having to transfer the entire rendered post content over
 the wire alongside the desired fields.
 While this whitelisting has no affect on the queries run when preparing
 the response, it can yield significant reductions in the bandwidth
 required to transfer a response payload for simple applications.

 Props adamsilverstein, TimothyBlynJacobs, svrooij.
 Fixes #38131.
 }}}

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


More information about the wp-trac mailing list