[wp-trac] [WordPress Trac] #38131: REST API: Provide interface to include or exclude specific fields from response JSON
WordPress Trac
noreply at wordpress.org
Sun Aug 27 13:02:36 UTC 2017
#38131: REST API: Provide interface to include or exclude specific fields from
response JSON
-------------------------+-----------------------------
Reporter: kadamwhite | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: REST API | Version: 4.4
Severity: normal | Resolution:
Keywords: | Focuses: performance
-------------------------+-----------------------------
Comment (by adamsilverstein):
@TimothyBlynJacobs Thanks for the updated patch here, it makes sense to
include the filtering code in the controller itself. The nested field
support is also nice - my only concern would be about the overhead.
In terms of limiting fields queried, there is a deeper issue here with
cache hydration - the query is expected to hydrate the cache for
subsequent queries (also the reason WP_QUERY only offers a few options for
it's '`fields` parameter). if we only queried for some fields, we couldn't
hydrate the cache fully, and subsequent (on the same page even) queries
for post data would fail (or need another query).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38131#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list