User Sync with copying avatars

Hi,

1. Do you know if User Sync can copy over the standard gravatar from Master to Slaves?
2. Is there an avatar plugin that works well with User Sync? What I mean is that the user can upload their avatar on the Master and then User Sync can synced with the Slaves and the avatar appear on the slaves too (assuming the same avatar upload functionality exists on Master and Slave)?

Thanks.

  • Sajid

    Hi @idesignstudio,

    Hope you are doing good today

    As stated earlier in your other thread, any thing stored in wp_users and wp_usermeta associated with a user will be transferred over to slave site.

    However, it will not move files from master to slave but it will still displays the the avatar on slave sites if its store the full address of the image including http.

    For example you have an avatar image store in master site at master.com and your moved the data on slave1.com then the image will be http://master.com/avatar.png on all of slave sites coming from master.

    Hope that helps! Feel free to post a reply if you need further assistance
    Cheers, Sajid

  • IDESIGNSTUDIO

    Hi Sajid,

    thanks for the replay.

    I continued to investigate the options and I narrowed down to this scenario.

    Regarding this article Custom Gravatars can be setup in WP like Bill Erickson explains. Or using a plugin like WP User Avatar. In both cases, the avatar image is saved in a user meta field. The image itself resides in the /wp-content/upload/ folder (because it is uploaded in the Media).

    Looking at this scenario, the question actually knocks down to the point to update a custom meta field from the user profile on the Master to the Slave, and this field is an URL to the avatar image. Am I getting the idea correct?
    Because the user meta field can be named differently, how can we specify which meta field is holding the image URL?

    Can it be done with some extra function/hook in the functions.php or any hints how to add it to User Sync plugin code? Most probably is a matter of 2 lines of code and may be the dev of the plugin can give a hint.

    I saw that this question popping out couple of times here in the support forum, but still couldn't find a shared solution or a hint.

    Looking forward to hearing from you

  • IDESIGNSTUDIO

    Hi,
    I keep diggin' in.

    I found the that specific meta field is in the core table wp_usermeta with a meta_key wp_user_avatar. The thing is that the value that stores is an ID of a media attachment, not a complete URL.
    The following function returns the complete image URI from media ID - wp_get_attachment_url( $id );
    So far, I found the necessary fields but have no idea how to plug it in the User Sync code to make it work. Could you please help on this?

    Thank you.

  • Nastia

    Hello IDESIGNSTUDIO, I hope you are well today!

    My sincerest apologies about delay on this ticket.

    WordPress currently only allows to use custom avatars that are uploaded through Gravatar. The user uploads their avatars at the Gravatar account, and the WordPress automatically shows registered user's Avatar.

    In case you wish to gic=ve the users the ability to upload their own Avatar, you can try the following most commonly used plugins. The users will choose between their Gravatar image or they can upload their own custom image:
    https://wordpress.org/plugins/wp-user-avatar/
    https://wordpress.org/plugins/avatar-manager/

    I hope this helps! Let us know if you require any further assistance!

    Cheers,
    Nastia