• Hello,

    I am new to wordpress and i am using basic user avatars plugin in order to allow logged in user to upload profile picture from font end. But the issue i am facing is that the image can be uploaded in wordpress-admin/user/user-profile but when the user logs in to the website and try to upload the image in edit account page the image doesnot update. I am using wordpress version 4.9.8. Please help me out.

    • This topic was modified 6 years, 3 months ago by Ash.
Viewing 2 replies - 1 through 2 (of 2 total)
  • I know this is few months old but I had the same problem and got it fixed. This plugin will not work if you are using endpoints in your URL, which is my case. I am using ‘/myaccount/avatar’ to display the avatar form, when the form is submitted, it automatically redirects to ‘/myaccount’ and $_POST is not checked there for the avatar update. So it never gets updated!

    A work arround is to add this function in your functions.php file:

    function check_for_avatar_update() {
    
    	$user_id = get_current_user_id();
    	if ( is_account_page() && isset( $_POST['manage_avatar_submit'] ) && class_exists( 'basic_user_avatars' ) ) {
    		$basic_user_avatars = new basic_user_avatars;
    		$basic_user_avatars->edit_user_profile_update( $user_id );
    	}
    
    } add_action('template_redirect', 'check_for_avatar_update');

    Hope it helps.

    Thread Starter Ash

    (@ash222)

    hi,

    Thank you soo much. I got this issue sorted.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image not getting updated from front end’ is closed to new replies.