[wp-trac] [WordPress Trac] #43874: REST API: Only render fields specific to request when _fields= is used
WordPress Trac
noreply at wordpress.org
Wed May 2 01:24:32 UTC 2018
#43874: REST API: Only render fields specific to request when _fields= is used
---------------------------------------------+-----------------------------
Reporter: danielbachhuber | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.9.7
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests commit | Focuses: rest-api,
| performance
---------------------------------------------+-----------------------------
Comment (by pento):
In [changeset:"43087" 43087]:
{{{
#!CommitTicketReference repository="" revision="43087"
REST API: Filter responses based on the `_fields` parameter, before data
is processed.
Historically, the REST API would generate the entire response object,
including running expensive filters, then it would apply the `_fields`
parameter, discarding the fields that weren't specificed.
This change causes `_fields` to be applied earlier, so that only requested
fields are processed.
Props danielbachhuber.
See #43874.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43874#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list