Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('get_avatar_data', 'own_get_avatar_data', 10, 2);
- function own_get_avatar_data($args, $id_or_email) {
- if (is_object($id_or_email) && $id_or_email->comment_type == 'review' && $id_or_email->comment_author_email == 'noemail@gmail.com') {
- $gravatar_url = get_comment_meta($id_or_email->comment_ID, 'gravatar_url', true);
- if ($args['height'] == 100) {
- $args['url'] = $gravatar_url;
- } else {
- if (!empty($args['height'])) {
- $param = $args['height'];
- } elseif (!empty($args['width'])) {
- $param = $args['width'];
- }
- $args['url'] = str_replace('s=100', "s=$param", $gravatar_url);
- }
- }
- return $args;
- }
Add Comment
Please, Sign In to add comment