wpseek.com
A WordPress-centric search engine for devs and theme authors
rest_validate_request_arg › WordPress Function
Since4.7.0
Deprecatedn/a
› rest_validate_request_arg ( $value, $request, $param )
Parameters: (3) |
|
Returns: |
|
Defined at: |
|
Codex: |
Validate a request argument based on details registered to the route.
Related Functions: rest_sanitize_request_arg, rest_parse_request_arg, rest_validate_enum, rest_do_request, wp_validate_user_request_key
Source
function rest_validate_request_arg( $value, $request, $param ) { $attributes = $request->get_attributes(); if ( ! isset( $attributes['args'][ $param ] ) || ! is_array( $attributes['args'][ $param ] ) ) { return true; } $args = $attributes['args'][ $param ]; return rest_validate_value_from_schema( $value, $args, $param ); }