Files
wordpress/wp-includes/rest-api
ellatrix 07202a2d74 REST API: Support nested _fields in revisions controller.
Use `rest_is_field_included()` instead of `in_array()` for `content`, `title`, `excerpt`, and `guid` fields in `WP_REST_Revisions_Controller`. This lets clients request specific sub-fields (e.g. `_fields=content.raw`) and skip expensive `the_content` rendering.

The [REST API `_fields` documentation](https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_fields) states that nested fields are supported using dot notation. However, the revisions controller uses `in_array()` which doesn't match nested keys like `content.raw`.

Developed in: https://github.com/WordPress/wordpress-develop/pull/11230.

Props ellatrix, andrewserong, mukeshpanchal27.
Fixes #64844.
Built from https://develop.svn.wordpress.org/trunk@61987


git-svn-id: http://core.svn.wordpress.org/trunk@61269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2026-03-12 13:22:43 +00:00
..