pre_get_avatar

过滤钩子


apply_filters( 'pre_get_avatar', null, $id_or_email, $args )
参数
  • (string|null)
    $avatar
    HTML for the user’s avatar. Default null.
    Required:
  • (mixed)
    $id_or_email
    The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash,
    user email, WP_User object, WP_Post object, or WP_Comment object.
    Required:
  • (array)
    $args
    Arguments passed to get_avatar_url(), after processing.
    Required:
定义位置
  • wp-includes/pluggable.php
    , line 2835
引入
4.2.0
弃用

Allows the HTML for a user’s avatar to be returned early.

Returning a non-null value will effectively short-circuit get_avatar(), passing
the value through the {@see ‘get_avatar’} filter and returning early.

$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );