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

		foreach ( $fields as $name => $args ) {
			$all_values = get_metadata( $this->get_meta_type(), $object_id, $name, 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 (object) $response;
	}
public function get_value( $object_id, $request ) {
		$fields   = $this->get_registered_fields();
		$response = array();

		foreach ( $fields as $name => $args ) {
			$all_values = get_metadata( $this->get_meta_type(), $object_id, $name, 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 (object) $response;
	}
public function get_value ( $ object_id , $ request ) { $ fields = $ this -> get_registered_fields ( ) ; $ response = array ( ) ; foreach ( $ fields as $ name => $ args ) { $ all_values = get_metadata ( $ this -> get_meta_type ( ) , $ object_id , $ name , 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 ( object ) $ response ; }
Get the `meta` field value.

@param int             $object_id Object ID to fetch meta for.
@param WP_REST_Request $request   Full details about the request.
@return WP_Error|object
Get the meta field value .