$is_valid =
rest_validate_value_from_schema( $value,
$args['schema'
], 'meta.' .
$name );
if ( is_wp_error( $is_valid ) ) { $is_valid->
add_data( array
( 'status' => 400
) );
return $is_valid;
} $value =
rest_sanitize_value_from_schema( $value,
$args['schema'
] );
if ( $args['single'
] ) { $result =
$this->
update_meta_value( $object_id,
$meta_key,
$name,
$value );
} else { $result =
$this->
update_multi_meta_value( $object_id,
$meta_key,
$name,
$value );
} if ( is_wp_error( $result ) ) { return $result;
} } return null;
} /**
* Deletes a meta value for an object.
*
* @since 4.7.0
*
* @param int $object_id Object ID the field belongs to.
* @param string $meta_key Key for the field.
* @param string $name Name for the field that is exposed in the REST API.
* @return true|WP_Error True if meta field is deleted, WP_Error otherwise.
*/