wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_update_entity_fields › WordPress Function

Since7.2.0
已弃用n/a
› wp_update_entity_fields ( $origin, $kind, $name, $fields, $script_module = null )
参数: (5)
  • (string) $origin Who updates 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 partial field definitions, each with the `id` of a registered field.
    Required: Yes
  • (string|null) $script_module The id of the script module providing the JavaScript parts of the fields, if any.
    Required: No
    默认: null
返回:
  • (string[]) The ids of the fields updated, in the order of the
    call. Empty when none is.
定义在:
文档:

Updates registered fields of an entity, see {@see WP_Entity_Fields_Registry::update()}.

It only runs on the wp_entity_fields_api_init action.


源码

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