/**

    *禁止没有头像的用户评论

    *https://www.weixiaoduo.com/validate-gravatar-comment/

*/

functionBing_validate_gravatar_comment($comment){

    $headers=@get_headers('http://cn.gravatar.com/avatar/'.md5(strtolower(trim($comment['comment_author_email']))).'?d=404');

    if(preg_match('|200|',$headers[0]))return$comment;

    wp_die(__('请使用有头像的邮箱','Bing'));

}

add_filter('preprocess_comment','Bing_validate_gravatar_comment');