W3cubDocs

/WordPress

WP_REST_Meta_Fields::register_field()

Registers the meta field.

Description

See also

Source

File: wp-includes/rest-api/fields/class-wp-rest-meta-fields.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(),
			)
		);
	}

Changelog

Version Description
4.7.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_meta_fields/register_field