WP_REST_Meta_Fields::register_field
Deprecated since 5.6.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Registers the meta field.
Method of the class: WP_REST_Meta_Fields{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_REST_Meta_Fields = new WP_REST_Meta_Fields(); $WP_REST_Meta_Fields->register_field();
Notes
Changelog
| Since 4.7.0 | Introduced. |
| Deprecated since | 5.6.0 |
WP_REST_Meta_Fields::register_field() WP REST Meta Fields::register field code WP 6.8.3
public function register_field() {
_deprecated_function( __METHOD__, '5.6.0' );
register_rest_field(
$this->get_rest_field_type(),
'meta',
array(
'get_callback' => array( $this, 'get_value' ),
'update_callback' => array( $this, 'update_value' ),
'schema' => $this->get_field_schema(),
)
);
}