Uses
Uses | Description |
---|---|
wp-includes/rest-api.php: rest_sanitize_value_from_schema() | Sanitize a value based on a schema. |
Sanitize a request argument based on details registered to the route.
(mixed) (Required)
(WP_REST_Request) (Required)
(string) (Required)
(mixed)
File: wp-includes/rest-api.php
function rest_sanitize_request_arg( $value, $request, $param ) { $attributes = $request->get_attributes(); if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) { return $value; } $args = $attributes['args'][ $param ]; return rest_sanitize_value_from_schema( $value, $args, $param ); }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_sanitize_request_arg