Last active
February 10, 2019 21:29
-
-
Save Faisalawanisee/298304c276e404ea350e72b758a49094 to your computer and use it in GitHub Desktop.
WordPress Add Custom Avatar
This file contains hidden or 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 | |
function filter_get_avatar_url( $url, $user_id ) { | |
// make filter magic happen here... | |
$get_img = get_user_meta( $user_id, 'meta_key', true ); | |
if($get_img){ | |
return $get_img; | |
} | |
return $url; | |
}; | |
add_filter( 'get_avatar_url', 'filter_get_avatar_url', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment