WP_REST_Meta_Fields::register_field()

In this article

This method has been deprecated. Use register_rest_field() instead.

Registers the meta field.

Description

See also

Source

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

Changelog

VersionDescription
5.6.0This method has been deprecated. Use register_rest_field() instead.
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.