• Resolved thekendog

    (@thekendog)


    On a form I have an ACF email field. How do I prepopulate this field with the email of the current user?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    If you’re talking about the ACF Extended Form, you have to map the Field Group that contain your Email field in your form and add a “User Action” to your form.

    Then in the “Load” tab of the User Action, enable the “load Values” setting, and choose your ACF field in the “User Email” field. See screenshot: https://i.imgur.com/dVBAQaa.png

    You’ll find more information about the User Action in the documentation here.

    Hope it helps!

    Have a nice day.

    Regards.

    Thread Starter thekendog

    (@thekendog)

    What happens if the user enters in a different email than the one of their account? Will it create a new user if I select that as the save action? What about if I select update user, will it auto change their email? I don’t want it to technically do any action, I just want it to populate.

    • This reply was modified 2 years, 11 months ago by thekendog.
    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Yes it does. The “User Action” is just a blank canvas that will perform the action of your choice on a specific user.

    I’m not sure of what you’re trying to achieve, but if you just want want to fill the input with the user email without updating it/create a new one, you’ll have to use the acf/load_value filter. See documentation.

    If you don’t need to perform any User Action, you can then just remove the Action from the UI.

    Regards.

    Thread Starter thekendog

    (@thekendog)

    Cool, the built in ACF filter works. Didn’t even think about using it.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I’m glad to hear it works as expected!

    If you enjoy this plugin and the support, feel free to submit a review, it always helps and it’s much appreciated 🙂

    Have a nice day.

    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Populate Field with Current User Email’ is closed to new replies.