Skip to content

Register and filter fields for DataViews/DataForm - #13911

Draft
oandregal wants to merge 2 commits into
WordPress:trunkfrom
oandregal:add/fields-api-endpoint
Draft

oandregal wants to merge 2 commits into
WordPress:trunkfrom
oandregal:add/fields-api-endpoint

Conversation

@oandregal

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/66229
See: WordPress/gutenberg#83368

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 5.5
Used for: Implementation. Reviewed and edited by me.

André Maneiro (via Claude) and others added 2 commits October 2, 2026 01:14
Moves the logic of `WP_REST_View_Config_Controller::cast_empty_objects()` to a function, so other controllers can serialize empty object-typed values as `{}` rather than `[]`. The method is deprecated in favor of the function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a server-side registry of the fields of an entity, `WP_Fields_Registry`, filled on the new `fields_api_init` action, where fields are registered, updated, and unregistered. Fields can also be declared as files and registered with `wp_register_field_collection()`.

The registered fields and the script modules providing their JavaScript parts are served by the `wp/v2/fields` route. The script modules are declared as dynamic dependencies of the `wp-editor` script, and the fields of the post types the post editor and the site editor list are preloaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oandregal oandregal changed the title Add/fields api endpoint Register and filter fields for DataViews/DataForm Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant