Used By
Used By | Description |
---|---|
wp-includes/rest-api/fields/class-wp-rest-meta-fields.php: WP_REST_Meta_Fields::get_value() | Retrieves the meta field value. |
Prepares a meta value for a response.
This is required because some native types cannot be stored correctly in the database, such as booleans. We need to cast back to the relevant type before passing back to JSON.
(mixed) (Required) Meta value to prepare.
(WP_REST_Request) (Required) Current request object.
(array) (Required) Options for the field.
(mixed) Prepared value.
File: wp-includes/rest-api/fields/class-wp-rest-meta-fields.php
protected function prepare_value_for_response( $value, $request, $args ) { if ( ! empty( $args['prepare_callback'] ) ) { $value = call_user_func( $args['prepare_callback'], $value, $request, $args ); } return $value; }
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/prepare_value_for_response