[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/build/scripts/core-fields/ -> index.php (summary)

Registers the fields of WordPress core through the Entity fields API, like a plugin registers its own. The default fields every post type derives from its supports are registered in code, see wp_register_core_post_type_supports_fields(). Their definitions are the `field.php` files of the `post_type_supports` folder. The post types whose fields differ from the defaults unregister the ones they do not get, as a plugin would, see wp_register_core_field_collections().

File Size: 149 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 functions

  wp_register_core_post_type_supports_fields()
  wp_register_core_field_collections()

Functions
Functions that are not part of a class:

wp_register_core_post_type_supports_fields()   X-Ref
Registers the default fields of each post type exposed in the REST API,
from what it supports, or whatever it supports:

- `author`, for the post types supporting `author`.
- `comment_status`, for the post types supporting `comments`.
- `date`, for every post type but the design ones.
- `discussion`, for the post types supporting `comments` or `trackbacks`.
- `excerpt`, for the post types supporting `excerpt`.
- `featured_media`, for the post types supporting `thumbnail` when the
theme supports post thumbnails for them.
- `format`, for the post types supporting `post-formats` when the theme
supports post formats.
- `last_edited_date`, for every post type.
- `notesCount`, for the post types whose `editor` support has the `notes`
argument.
- `parent`, for the post types supporting `page-attributes`.
- `password`, for every post type but the design ones.
- `ping_status`, for the post types supporting `trackbacks`.
- `post-content-info`, for the post types supporting `editor`.
- `scheduled_date`, for every post type but the design ones.
- `slug`, for the viewable post types but the design ones.
- `status`, for every post type but the design ones.
- `sticky`, for posts, the only post type with sticky posts.
- `template`, for every post type but the design ones.
- `title`, for the post types supporting `title`.

It makes no exception for any post type: the fields a post type does not
get are unregistered afterwards, see wp_register_core_field_collections().

Only some fields have JavaScript parts, but every field is registered
with the script module of the folder: a post type supporting only
comments or notes lists the module too, which is small.


wp_register_core_field_collections()   X-Ref
Registers the fields of WordPress core: the defaults first, without the
ones the core post types do not get, then the collections of single post
types, then the collection of the site.

Hooked at priority 0, so a plugin hooking `wp_entity_fields_api_init` at the
default priority sees the core fields registered, and can update or
unregister them.




Generated : Thu Oct 22 08:20:34 2026 Cross-referenced by PHPXref