add_filter( 'get_avatar' , 'my_custom_avatar' , 1 , 5 );
function my_custom_avatar( $avatar, $id_or_email, $size, $default, $alt) {
    
    if ( ! empty( $id_or_email->user_id ) ) {
        $avatar = "http://static.cnblogs.com/images/logo_small.gif";
    }else{
        $avatar = "http://static.cnblogs.com/images/logo_small.gif";
    }
    $avatar = "<img alt='{$alt}' src='{$avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";

    return $avatar;
}

 

相关文章:

  • 2021-08-09
  • 2021-09-02
  • 2021-05-17
  • 2021-07-03
  • 2021-11-17
  • 2021-12-05
  • 2022-12-23
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2021-12-14
  • 2021-09-16
  • 2021-12-08
  • 2022-02-23
相关资源
相似解决方案