rest_get_avatar_urls() - WordPress 函数参考中文文档

返回介绍

rest_get_avatar_urls()

发布于 2017-09-11 字数1567 浏览 852 评论 0

rest_get_avatar_urls( string $email )

Retrieves the avatar urls in various sizes based on a given email address.


描述


参数

$email

(string)
(Required)
Email address.


返回值

(array) $urls Gravatar url for each size.


源代码

File: wp-includes/rest-api.php

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

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

	return $urls;
}

更新日志

Version 描述
4.7.0 Introduced.

相关函数

Uses

  • wp-includes/rest-api.php:
    rest_get_avatar_sizes()
  • wp-includes/link-template.php:
    get_avatar_url()

Used By

  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::prepare_item_for_response()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::prepare_item_for_response()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!