wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



rest_parse_request_arg › WordPress Function

Od4.7.0
Przestarzałyn/a
rest_parse_request_arg ( $value, $request, $param )
Parametry: (3)
  • (mixed) $value
    Wymagane: Tak
  • (WP_REST_Request) $request
    Wymagane: Tak
  • (string) $param
    Wymagane: Tak
Powrót:
  • (mixed)
Zdefiniowane na:
Codex:

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

Runs a validation check and sanitizes the value, primarily to be used via the sanitize_callback arguments in the endpoint args registration.


Źródło

function rest_parse_request_arg( $value, $request, $param ) {
	$is_valid = rest_validate_request_arg( $value, $request, $param );

	if ( is_wp_error( $is_valid ) ) {
		return $is_valid;
	}

	$value = rest_sanitize_request_arg( $value, $request, $param );

	return $value;
}