wpseek.com
A WordPress-centric search engine for devs and theme authors
rest_sanitize_request_arg › WordPress Function
Since4.7.0
Deprecatedn/a
› rest_sanitize_request_arg ( $value, $request, $param )
Parameters: (3) |
|
Returns: |
|
Defined at: |
|
Codex: |
Sanitize a request argument based on details registered to the route.
Related Functions: rest_validate_request_arg, rest_parse_request_arg, rest_sanitize_array, rest_sanitize_object, rest_sanitize_boolean
Source
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 ); }