rest_get_avatar_urls()

最后更新于:2021-11-27 23:36:14

rest_get_avatar_urls( mixed$id_or_email)

Retrieves the avatar urls in various sizes.

参数

$id_or_email

(mixed) (Required) The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, user email, GC_User object, GC_Post object, or GC_Comment object.

响应

(array) Avatar URLs keyed by size. Each value can be a URL string or boolean false.

源文件

文件: gc-includes/rest-api.php

function rest_get_avatar_urls( $id_or_email ) {
	$avatar_sizes = rest_get_avatar_sizes();

	$urls = array();
	foreach ( $avatar_sizes as $size ) {
		$urls[ $size ] = get_avatar_url( $id_or_email, array( 'size' => $size ) );
	}

	return $urls;
}