Last active
April 27, 2021 15:44
-
-
Save champsupertramp/f2c37356396f6c7d2366 to your computer and use it in GitHub Desktop.
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 | |
/*** | |
*** @Dettach um default avatar | |
***/ | |
add_filter('avatar_defaults', 'um_avatar_defaults', 99999 ); | |
function um_avatar_defaults($avatar_defaults) { | |
remove_filter('get_avatar', 'um_get_avatar', 99999, 5); | |
return $avatar_defaults; | |
} | |
/*** | |
*** @Override avatars with a high priority | |
***/ | |
add_filter('get_avatar', 'my_own_avatar', 999999, 5); | |
function my_own_avatar($avatar = '', $id_or_email='', $size = '96', $avatar_class = '', $default = '', $alt = '') { | |
// Insert new source of avatar | |
} | |
?> |
Hi @diegopau
You can add the direct Image URL.
add_filter("um_get_option_filter__default_avatar","um_get_option_filter__default_avatar", 10, 1);
function um_get_option_filter__default_avatar( $option ){
$option = "https://via.placeholder.com/250";
return $option;
}
Regards,
Thanks, however it is not working.
I tried adding this to functions.php but I still see the old default avatar
add_filter("um_get_option_filter__default_avatar","um_get_option_filter__default_avatar", 999999, 1);
function um_get_option_filter__default_avatar( $option ){
$option = "https://s3.us-east-2.amazonaws.com/oceanbuilders.com/web_assets/default-avatar.svg";
return $option;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @champsupertramp would it be possible to get an update of this gist so it works with the latest version of Ultimate Member?
I am trying something with:
But I don't know how to assign the new URL to the array $option, I am not a developer.