Repository navigation
Commit 1c86d8c
REST API: Add the entity fields endpoint.
Registers the `/wp/v2/entity-fields` route, served by `WP_REST_Entity_Fields_Controller`. Given an entity kind and name, it returns the fields registered for the entity with the Entity Fields API, and the script modules providing their JavaScript parts, each with the ids of the fields it applies to.
Access mirrors the `/wp/v2/view-config` route: post types require their own `edit_posts` capability, taxonomies their `manage_terms` capability, and root entities `manage_options`. Post types and taxonomies that are not registered or not exposed in the REST API are not found.
Synced from WordPress/gutenberg#84078.
Synced from WordPress/gutenberg#84691.
See #66229.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent f3ceadf commit 1c86d8c
4 files changed
Lines changed: 679 additions & 0 deletions
File tree
- src/wp-includes
- tests
- phpunit/tests/rest-api
- qunit/fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
443 | 447 | | |
444 | 448 | | |
445 | 449 | | |
| |||
0 commit comments