WordPress at a glance
function is not described

WP_REST_Meta_Fields::register_field() public WP 4.7.0

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

  • See: register_rest_field()

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Meta_Fields::register_field() WP 5.5.1

<?php
public function register_field() {
	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(),
		)
	);
}