• Resolved powermaniac

    (@powermaniac)


    First off, thanks for the plugin. It looks like it was built very well. I’m just having a small issue with front-end image uploads. I’m able to change my avatar as an admin user (it uses the gallery), but I can’t do so as a normal subscriber. Once I choose the image and click upload, it refreshes the page after a second or two. I don’t think the image is actually being uploaded, as it doesn’t show a percentage at the bottom of my browser, and it’s too large to upload that fast. If I try to upload the image from the backend under “Profile”, it does work, though. Any ideas? Thanks.

    https://www.ads-software.com/plugins/wp-user-avatar/

Viewing 5 replies - 1 through 5 (of 5 total)
  • A common issue with these “front-end” profiles is that they need enctype="multipart/form-data" added to the form code. Which plugin are you using?

    Thread Starter powermaniac

    (@powermaniac)

    Hi Bangbay, I don’t use a plugin – just some standard code that pulls from the backend and writes to it (easier for me to edit and change than a plugin). I’ve had big issues with avatar upload though, and your plugin works great. Adding the multipart also fixed it. Thanks – you’re amazing! I do have another question for the time being, though. Would I be able to move the form to a different part of the form? As it sits now, its right below “Biographical Information”. I have some extra fields that I added below that, which I call with:

    do_action(‘edit_user_profile’,$current_user);

    So, I have the standard name, email, etc -> avatar ?? -> my custom fields like Google+, phone #, etc. How could I put the avatar at the bottom for example?

    Thanks again Bangbay, from another LA Resident ??

    You could try putting the avatar code in its own section. Underneath do_action('edit_user_profile',$current_user); you could add
    do_action('edit_user_avatar',$current_user);

    Then in your functions.php, you can add this:

    if(!is_admin()){
      remove_action('edit_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
      remove_action('edit_user_profile', array('wp_user_avatar', 'wpua_media_upload_scripts'));
      add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_action_show_user_profile'));
      add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_media_upload_scripts'));
    }
    Thread Starter powermaniac

    (@powermaniac)

    I was able to add it with that code, though I still have the old one in there as well. I’ll mess with it and try to figure that part out. I had some other questions in regards to the plugin, if you don’t mind… I just don’t know if I should create a whole new thread every time, or just add it here? Thanks again for all the help ??

    If you’re also using ‘show_user_profile’, you’ll have to add this to the above block:

    remove_action('show_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
    remove_action('show_user_profile', array('wp_user_avatar', 'wpua_media_upload_scripts'));

    If you have questions that are for other features, please start a new thread or contact me privately. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘issues with image upload’ is closed to new replies.