WP_REST_Meta_Fields
class WP_REST_Meta_Fields
// Constructor: function Object() { [native code] } Core class to manage meta values for an object via the REST API.
Methods 17 methods
| Method / Return | Description |
|---|---|
| get_meta_type() string | Retrieves the object meta type. |
| get_meta_subtype() string | Retrieves the object meta subtype. |
| get_rest_field_type() string | Retrieves the object type for register_rest_field(). |
| register_field() void | Registers the meta field. |
| get_value() array | Retrieves the meta field value.
Parameters: $object_id: mixed, $request: mixed |
| prepare_value_for_response() mixed | Prepares a meta value for a response.
Parameters: $value: mixed, $request: mixed, $args: mixed |
| update_value() (null | Updates meta values.
Parameters: $meta: mixed, $object_id: mixed |
| delete_meta_value() (true | Deletes a meta value for an object.
Parameters: $object_id: mixed, $meta_key: mixed, $name: mixed |
| update_multi_meta_value() (true | Updates multiple meta values for an object.
Parameters: $object_id: mixed, $meta_key: mixed, $name: mixed, $values: mixed |
| update_meta_value() (true | Updates a meta value for an object.
Parameters: $object_id: mixed, $meta_key: mixed, $name: mixed, $value: mixed |
| is_meta_value_same_as_stored_value() bool | Checks if the user provided value is equivalent to a stored value for the given meta key.
Parameters: $meta_key: mixed, $subtype: mixed, $stored_value: mixed, $user_value: mixed |
| get_registered_fields() array | Retrieves all the registered meta fields. |
| get_field_schema() array | Retrieves the object's meta schema, conforming to JSON Schema. |
| prepare_value() mixed | Prepares a meta value for output.
Parameters: $value: mixed, $request: mixed, $args: mixed |
| check_meta_is_array() (array | Check the 'meta' value of a request is an associative array.
Parameters: $value: mixed, $request: mixed, $param: mixed |
| default_additional_properties_to_false() array | Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting
Parameters: $schema: mixed |
| get_empty_value_for_type() mixed | Gets the empty value for a schema type.
Parameters: $type: mixed |