rest_validate_request_arg

Advertisement

Summery Summery

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

Syntax Syntax

rest_validate_request_arg( mixed $value, WP_REST_Request $request, string $param )

Parameters Parameters

$value

(mixed) (Required)

$request

(WP_REST_Request) (Required)

$param

(string) (Required)

Return Return

(true|WP_Error)

Source Source

File: wp-includes/rest-api.php

 *
 * @see get_avatar_url()
 *
 * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,
 *                           user email, WP_User object, WP_Post object, or WP_Comment object.
 * @return array Avatar URLs keyed by size. Each value can be a URL string or boolean false.
 */
function rest_get_avatar_urls( $id_or_email ) {
	$avatar_sizes = rest_get_avatar_sizes();

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.