Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching IDs can cause WP Users to pick up Guest Author avatars in WP Admin #907

Closed
laurelfulford opened this issue Dec 22, 2022 · 2 comments
Assignees
Milestone

Comments

@laurelfulford
Copy link

When a WP User and Guest Author share the same ID, the WP User can pick up the wrong avatar in the backend.

Steps to reproduce:

  1. Start with a test site that has a Guest Author and WP User that share the same ID. If you don't already have one, the quickest way to recreate is:
    • Set up a new site.
    • Before adding/importing any posts, install CoAuthors Plus and create a Guest Author. Usually they will have an ID around 5-6. This is necessary because Guest Authors share the same ID pool as other post types.
    • Create 5-6 regular WP Users, until you have one whose ID matches your Guest Author.
  2. Give your "ID twin" Guest Author an avatar.
  3. You can also give your "ID twin" WP User an email address that's associated with a Gravatar, but it's not necessary.
  4. View the user list under WP Admin > Users, or view the individual profile of your "ID twin" WP User. Note that the avatar its using is the one assigned to your Guest Author.

Screenshots

Guest author settings:

image

"ID twin" WP User on the Users screen:

image

Actual avatar the WP User should be using:

image

@davidvexel
Copy link

Having this same issue and I think it's because the filter in filter_pre_get_avatar_url is assuming that the $id parameter sent is an Author ID, which is incorrect, I'm seeing the user ID there.

https://github.com/Automattic/Co-Authors-Plus/blob/master/co-authors-plus.php#L1825-L1840

@GaryJones
Copy link
Contributor

GaryJones commented Jul 29, 2023

Fixed in #960.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants