wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_register_entity_fields › WordPress Function

Since7.2.0
Deprecatedn/a
› wp_register_entity_fields ( $origin, $kind, $name, $fields, $script_module = null )
Parameters: (5)
  • (string) $origin Who registers the fields: `core`, or the slug of the plugin or theme.
    Required: Yes
  • (string) $kind The entity kind (e.g. `postType`).
    Required: Yes
  • (string) $name The entity name (e.g. `page`).
    Required: Yes
  • (array[]) $fields The list of field definitions, each with an `id`.
    Required: Yes
  • (string|null) $script_module The id of the script module providing the JavaScript parts of the fields, if any.
    Required: No
    Default: null
Returns:
  • (string[]) The ids of the fields registered, in the order of the
    call. Empty when none is.
Defined at:
Codex:

Registers fields for an entity, see {@see WP_Entity_Fields_Registry::register()}.

It only runs on the wp_entity_fields_api_init action.


Source

function wp_register_entity_fields( $origin, $kind, $name, $fields, $script_module = null ) {
	return WP_Entity_Fields_Registry::get_instance()->register( $origin, $kind, $name, $fields, $script_module );
}