过滤要检索的头像。
原型
apply_filters( 'get_avatar', string $avatar, mixed $id_or_email, int $size, string $default, string $alt, array $args )
参数
$avatar
(string)
用户头像的标签。
$id_or_email
(mixed)
要检索的Gravatar。接受user_id,gravatar md5哈希,用户电子邮件,WP_User对象,WP_Post对象或WP_Comment对象。
$size
(int)
方形头像宽度和高度(以像素为单位)进行检索。
$default
(string)
默认图像的URL或默认类型。接受’404’,‘retro’,‘monsterid’,‘wavatar’,‘indenticon’,‘mystery’(或’mm’或’mysteryman’),‘blank’或’gravatar_default’。默认值是’avatar_default’选项的值,后缀为’mystery’。
$alt
(string)
在头像图片标签中使用的替代文字。默认为空。
$args
(array)
处理后,参数传递给get_avatar_data()。
源文件
路径:wp-includes/pluggable.php
其他
英文文档:https://developer.wordpress.org/reference/hooks/get_avatar/