• Resolved OffWorld

    (@offworld)


    I’m working on a site with a frontend user profile form. I figured out how to get it to show up on the front-end form, and I got the AJAX to work on the front-end for selecting an image file and showing it in the form, but if I press “Delete Local Avatar” the thumbnail disappears completely, it doesn’t switch back to the default avatar thumbnail, nor will the avatar actually be updated when the frontend profile is updated (everything ELSE in the profile updates, just not the avatar). I also tried detecting the $_POST and $_FILES from the plugin on form submission, and triggering things like “edit_user_profile_update” within my own form validation function, but I never got this to work and gave up. There only like one thread on WordPress StackExchange about using this plugin on the frontend and none of what I found there worked for me. Is this even possible to do?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Darin Kotter

    (@dkotter)

    @offworld When you say you got it to show up on the front-end, how is that set up? Are you loading the same stuff that would normally load in the admin? Or are you doing a more custom integration? I’m guessing it’s the former since you mention the Delete Local Avatar button.

    There have been two recent support topics that may help you: https://www.ads-software.com/support/topic/how-to-set-avatar-programmatically/ and https://www.ads-software.com/support/topic/uploading-on-the-front-end/. In this case, they built a custom integration that uses some of the methods from Simple Local Avatars to build the front-end form. That’s going to be your best bet to get this to work.

    Thread Starter OffWorld

    (@offworld)

    I got it to show up on the front-end in a custom form in a custom template with:

    do_action('show_user_profile',$current_user);
    do_action('edit_user_profile',$current_user);

    Which loops in all the theme and plugin additions to the admin User Profile (but just the form elements, not any admin scripts or stylesheets that go with them). Looking at those two other threads you linked to I now see where I was probably going wrong in my form validation function.

    Ultimately for the site project in my original post I ended up using the “One User Avatar” plugin which has built-in methods for adding the form to the front-end.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use on frontend Profile form?’ is closed to new replies.