Created
October 9, 2018 09:45
-
-
Save temsool/2b526613fd04a5f8c627d78cf7afec68 to your computer and use it in GitHub Desktop.
elementor gravatar fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('get_avatar_url', function( $url, $id_or_email, $args ) { | |
if (is_email($id_or_email)) { | |
$user = get_user_by('email', $id_or_email); | |
$user_id = $user->ID; | |
} else { | |
$user_id = $id_or_email; | |
} | |
if (has_wp_user_avatar($user_id)) { | |
return get_wp_user_avatar_src($user_id, 'writer-avatar'); | |
} | |
return $url; | |
}, 10, 3); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment