WordPress at Your Fingertips
function is not described

WP_REST_Meta_Fields::register_field() public WP 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.

{} It's a method of the class: WP_REST_Meta_Fields{}

No Hooks.

Return

null. Nothing.

Usage

$WP_REST_Meta_Fields = new WP_REST_Meta_Fields();
$WP_REST_Meta_Fields->register_field();

Notes

Changelog

Since 4.7.0 Introduced.
Deprecated 5.6.0

Code of WP_REST_Meta_Fields::register_field() WP 5.8

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