Home › Forums › General Issues › Saving fields to user registration form › Reply To: Saving fields to user registration form
Hi @dhod and @bowersinit
when using acf_form within another field like this there’s no automagic saving happening so you’ll have to do that yourself (as you figured out).
I think what you need is to hook into the user_register
action:
https://codex.wordpress.org/Plugin_API/Action_Reference/user_register
and save the ACF input values to their respective fields. Something like:
function save_additional_user_meta( $user_id ) {
if ( isset( $_POST['NAME PARAMETER OF THE ACF INPUT FIELD'] ) )
update_user_meta($user_id, 'first_name', $_POST['NAME PARAMETER OF THE ACF INPUT FIELD']);
}
add_action( 'user_register', 'save_additional_user_meta', 10, 1 );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.