Gary Pendergast 96c83f4400 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.

Merges [43087] to the 4.9 branch.

Props danielbachhuber.
See #43874.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43445 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 06:50:51 +00:00
..