wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



rest_validate_request_arg › WordPress Function

Da4.7.0
Deprecaton/a
› rest_validate_request_arg ( $value, $request, $param )
Parametri: (3)
  • (mixed) $value
    Richiesto: Sì
  • (WP_REST_Request) $request
    Richiesto: Sì
  • (string) $param
    Richiesto: Sì
Ritorna:
  • (true|WP_Error)
Definito a:
Codex:

Validate a request argument based on details registered to the route.



Sorgenti

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 );
}