[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 23:30:34 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 danielbachhuber):
Replying to [comment:9 TimothyBlynJacobs]:
> If the `_fields` parameter is going to start being checked off of the
request object especially in controllers, might it be worth adding it to
`WP_REST_Controller::get_collection_params()`?
The `_` underscore denotes that it's a "magic" parameter handled by the
server, not the controller. Even though our new implementation includes
performance enhancements handled by the controller, `_fields` is
ultimately a server-level feature. So no, I don't think it's necessary to
include it as a collection parameter.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43874#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list