WordPress at a glance
функция не описана

WP_REST_Meta_Fields::get_value() public WP 4.7.0

Retrieves the meta field value.

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

Хуков нет.

Возвращает

Array. Array containing the meta values keyed by name.

Использование

$WP_REST_Meta_Fields = new WP_REST_Meta_Fields();
$WP_REST_Meta_Fields->get_value( $object_id, $request );
$object_id(int) (required)
Object ID to fetch meta for.
$request(WP_REST_Request) (required)
Full details about the request.

Changelog

Since 4.7.0 Introduced.

Код WP_REST_Meta_Fields::get_value() WP 5.5.1

<?php
public function get_value( $object_id, $request ) {
	$fields   = $this->get_registered_fields();
	$response = array();

	foreach ( $fields as $meta_key => $args ) {
		$name       = $args['name'];
		$all_values = get_metadata( $this->get_meta_type(), $object_id, $meta_key, false );

		if ( $args['single'] ) {
			if ( empty( $all_values ) ) {
				$value = $args['schema']['default'];
			} else {
				$value = $all_values[0];
			}

			$value = $this->prepare_value_for_response( $value, $request, $args );
		} else {
			$value = array();

			foreach ( $all_values as $row ) {
				$value[] = $this->prepare_value_for_response( $row, $request, $args );
			}
		}

		$response[ $name ] = $value;
	}

	return $response;
}