Commit 972f249935 for wordpress.org
commit 972f249935e7bdef4b872477450326127097c911
Author: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Date: Mon Oct 19 20:36:52 2026 +0000
Editor: Register the core entity fields on the server.
Gutenberg registers the core fields (title, author, status, the media fields, …) on the server through the entity fields API, and the editors read them from the `wp/v2/entity-fields` route. Core has the API but registered no fields, so the title column of the Site Editor's pages list was blank. Register them in Core the same way.
Copy the PHP files of `@wordpress/core-fields` from the Gutenberg build in the `gutenberg-php` Grunt copy task, next to the core actions, and load their `index.php` from `wp-settings.php`. They register the default fields every post type gets from its supports, plus the field collections of pages, templates, template parts, patterns, attachments, navigation menus, and the site.
The entity fields tests now swap the core fields for their fixture defaults, so they still test the API on its own. The tests for the core fields are skipped until the pinned Gutenberg build includes them.
Developed in https://github.com/WordPress/wordpress-develop/pull/14512.
Synced from https://github.com/WordPress/gutenberg/pull/84696.
Follow-up to [64528].
Props oandregal, jorgefilipecosta.
Fixes #66229.
Built from https://develop.svn.wordpress.org/trunk@64581
git-svn-id: http://core.svn.wordpress.org/trunk@63731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/entity-fields.php b/wp-includes/entity-fields.php
index fff833b678..91a0547557 100644
--- a/wp-includes/entity-fields.php
+++ b/wp-includes/entity-fields.php
@@ -19,7 +19,9 @@
* Fields can also be declared as files, grouped in a field collection, which
* a `wp_entity_fields_api_init` callback registers with
* {@see wp_register_entity_field_collection()}. A collection is for a single
- * entity.
+ * entity. WordPress core registers its own fields this way, from
+ * packages/core-fields: the defaults every post type derives from its
+ * supports in code, the fields of single post types as collections.
*
* The registered fields are exposed by the `/wp/v2/entity-fields` REST API
* route, see {@see WP_REST_Entity_Fields_Controller}.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 60dc86fbc4..b0d02e31ab 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-64580';
+$wp_version = '7.2-alpha-64581';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
diff --git a/wp-settings.php b/wp-settings.php
index cc7a1e00a3..8bd37b43d6 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -257,6 +257,9 @@ if ( file_exists( ABSPATH . WPINC . '/build/pages.php' ) ) {
if ( file_exists( ABSPATH . WPINC . '/build/scripts/core-actions/index.php' ) ) {
require ABSPATH . WPINC . '/build/scripts/core-actions/index.php';
}
+if ( file_exists( ABSPATH . WPINC . '/build/scripts/core-fields/index.php' ) ) {
+ require ABSPATH . WPINC . '/build/scripts/core-fields/index.php';
+}
require ABSPATH . WPINC . '/taxonomy.php';
require ABSPATH . WPINC . '/class-wp-taxonomy.php';
require ABSPATH . WPINC . '/class-wp-term.php';