Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can user change the own gravatar image from front end? for the back-end there are lot of plugins (like user photo etc.), by which user can easily change the gravatar image?

share|improve this question
    
I think you mean avatar, not gravatar? –  birgire Jan 20 at 10:58
    
Please explain more precisely what you want to do. –  Brad Dalton Jan 20 at 11:29
    
i have created a custom form and i want that user can upload any picture from front-end and it will save on back-end and that image should be visible on profile page on back-end(yourdomain/wp-admin/profile.php) –  Yogesh Jan 20 at 11:41

1 Answer 1

They can change the image in their Gravatar account.

Or set a default from the backend which isn't what you asked originally

add_filter( 'avatar_defaults' , 'default_avatar' );

function default_avatar( $avatar_defaults ){

$new_avatar = get_stylesheet_directory_uri() . '/images/default-gravatar.png';

$avatar_defaults[$new_avatar] = "Gravatar";

return $avatar_defaults;
}

Source Replace default avatar

share|improve this answer
    
yes i know that, can we change the gravatar image pragmatically?Is their a wordpress function for this? –  Yogesh Jan 20 at 9:42
    
Its based on the email address. You want to change it from the front end? The only way is to change the image on the account or change the email address submitted. codex.wordpress.org/Using_Gravatars –  Brad Dalton Jan 20 at 10:39
    
yes i want to change it from front end, i am creating an user registration page on front-end from where user can change the gravatar image. –  Yogesh Jan 20 at 10:52
    
user can upload his custom image from front end and it should be saved as his gravatar image. –  Yogesh Jan 20 at 11:02
    
Not how Gravatar works as you upload the image from the front end of your Gravatar account. I think you're referring to allowing users to upload a Avatar image. –  Brad Dalton Jan 20 at 11:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.