• Howdy,
    This is undoubtedly an awesome plugin. I am impressed with this valuable plugin. But I am a bit stuck creating a user profile edit page on the frontend. Let me explain a bit:

    I have created some fields in the ACF UI in the backend that are assigned to user profile. Those works great as expected in the backend, but I am using this plugin to enable logged in users edit their profile frontend. So, I assigned the form group to a From created this plugin and used the shortcode to show in a page.

    The form is showing well with all the fields, but it looks like the user is creating a new profile as the fields aren’t populated with the data the user already have in their profile. Please check the attached file.

    So, is there any way to create an actual edit page so the fields don’t show empty?

    FrontEnd Profile Edit Page

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi!

    Really glad you are enjoying AF, and I think I can help.

    Advanced Forms doesn’t come with the functionality to edit users by default, fortunately it’s quite easy to extend. (I’m thinking of adding this feature with a dedicated plugin)

    If you use the helper function advanced_form to display your form you can pass an array of field values to prefill. I would recommend retrieving and then passing the current users data to the function. Here’s the documentation for advanced_form: https://advancedforms.github.io/guides/basic/displaying-a-form/

    Once the form has been submitted you need to save the new values to your user as well. Use the af/form/submission hook and then update the current user with your new values. The documentation has some examples: https://advancedforms.github.io/guides/basic/processing-form-submissions/

    Did this help you out? 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘FrontEnd User Profile Edit Page’ is closed to new replies.