Plugin Support
Yurii
(@yuriinalivaiko)
Hello @lentini84
The Ultimate Member plugin allows members to upload a profile photo (avatar) in their profiles. Uploaded profile photos override default WordPress gravatars.
The Basic User Avatars plugin also overrides default WordPress gravatars but has less priority then the Ultimate Member profile photo.
You can use custom code to remove filters used by the Ultimate Member plugin to display uploaded profile photos.
Try this code snippet to disable the Ultimate Member profile photo:
remove_filter( 'get_avatar', 'um_get_avatar', 99999 );
remove_filter( 'get_avatar_url', 'um_filter_get_avatar_url', 20 );
Try this code snippet to disable the Ultimate Member profile photo for users who have the Basic User Avatars image:
remove_filter( 'get_avatar', 'um_get_avatar', 99999 );
add_filter( 'get_avatar', function( $avatar, $user_id, $size, $avatar_class = '', $default = '', $alt = '' ) {
if ( is_numeric( $user_id ) ) {
$local_avatars = get_user_meta( $user_id, 'basic_user_avatar', true );
if ( empty( $local_avatars ) ) {
$avatar = um_get_avatar( $avatar, $user_id, $size, $avatar_class, $default, $alt );
}
}
return $avatar;
}, 999, 5 );
Regards
wow, thank you very much for the exhaustive answer 🙂 thank you for the codes, everything works as it should now 🙂
By the way, I have one more question – under I sent a photo of my https://laczynasdart.pl/account/
https://snipboard.io/8xTAPe.jpg
When I change the data and click “update account” redirect me to https://laczynasdart.pl/account/general/?updated=account, where I get a message – error 404. The requested page does not exist or has been moved.
Interestingly – the data was saved correctly after all. But what should I do to prevent this message from appearing? I need to create a page?
Thank you in advance for the information 🙂
there is NO “profile photo” in my predefined fields…
Plugin Support
Yurii
(@yuriinalivaiko)
Hello @lentini84
There is no “profile photo” field in the Ultimate Member core plugin. The profile photo uploader is a built-in profile feature placed in the profile header. See https://docs.ultimatemember.com/article/1603-how-to-upload-profile-photo
You can install a free extension if you need the “Profile Photo” field in the registration form. See https://docs.ultimatemember.com/article/1671-nable-profile-photo-uploader-in-register-and-account-forms
The https://laczynasdart.pl/account/general/?updated=account is a valid link and proper redirect after an account updating.
An Account page permalink structure is {protocol}://{website_domain}/{page_slug}/{tab_slug}/?{parameters} where {tab_slug} and {parameters} are optional.
Maybe something is wrong with permalinks on your site. Do you use the Account page for something else? You should not use this page in other plugins.
What permalink structure do you use? Look at wp-admin > Settings > Permalinks to see your Permalink structure setting. The “Post name” is a recommended option for the permalink structure.
Regards
Hi @lentini84
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards
Thank you for your help 🙂