WP_REST_Meta_Fields::register_field()publicWP 4.7.0

Deprecated from version 5.6.0. It is no longer supported and can 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.

Return

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() code WP 6.5.2

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(),
		)
	);
}