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

返回介绍

rest_get_avatar_sizes()

发布于 2017-09-11 字数1636 浏览 914 评论 0

rest_get_avatar_sizes()

Retrieves the pixel sizes for avatars.


描述


返回值

(array) List of pixel sizes for avatars. Default [ 24, 48, 96 ].


源代码

File: wp-includes/rest-api.php

function rest_get_avatar_sizes() {
	/**
	 * Filters the REST avatar sizes.
	 *
	 * Use this filter to adjust the array of sizes returned by the
	 * `rest_get_avatar_sizes` function.
	 *
	 * @since 4.4.0
	 *
	 * @param array $sizes An array of int values that are the pixel sizes for avatars.
	 *                     Default `[ 24, 48, 96 ]`.
	 */
	return apply_filters( 'rest_avatar_sizes', array( 24, 48, 96 ) );
}

更新日志

Version 描述
4.7.0 Introduced.

相关函数

Uses

  • wp-includes/rest-api.php:
    rest_avatar_sizes
  • wp-includes/plugin.php:
    apply_filters()

Used By

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

User Contributed Notes

发布评论

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

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