Skip to content

Custom avatar not shown if set default avatar #403

Closed

Description

@tambaqui

Current Outcome

If we enable the option to allow users to upload personalized avatars for their profiles, and they upload their own avatar, this is displayed as long as we do not establish a default avatar in WP User Manager Settings, but if we establish a default one it has
priority over the one uploaded by the user himself.

Desired Outcome

The user's avatar should take priority over the default avatar.

Steps to Reproduce

  1. Activate the Custom Avatars option in WP User Manager Settings > Profiles.
  2. With a logged in user upload an image in the "Profile picture" account edition and save changes. The user's avatar is displayed correctly.
  3. Upload a default avatar in WP User Manager Settings > Profiles and save.

Suggestions

In the WPUM_Avatars class there are two filters for get_avatar_url with the same priority:
First declare this:
add_filter('get_avatar_url', array($this, 'set_avatar_url'), 10, 3);
And then this:
add_filter('get_avatar_url', array($this, 'set_default_avatar'), 10, 3);

This being so, the set_default_avatar will be executed later so it will overwrite the user's avatar.

You could change the order in the code, or change the priorities so that set_avatar_url is executed after set_default_avatar. Example:

add_filter('get_avatar_url', array($this, 'set_avatar_url'), 11, 3);
add_filter('get_avatar_url', array($this, 'set_default_avatar'), 10, 3);

Activity

  1. added a commit that references this issue on Aug 16, 2025
    8715383
  2. added a commit that references this issue on Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions