Home › Forums › General Issues › Saving fields to user registration form › Reply To: Saving fields to user registration form
Hi @bowersinit
When an input has a name value like fields[field_55e57136adc2e]
the $_POST value will actually be an array called fields with a fieldkey of field_55e57136adc2e which in term contains the value.
So try this out:
function save_additional_user_meta( $user_id ) {
if ( isset( $_POST['fields']['field_55e57136adc2e'] ) )
update_user_meta($user_id, 'number_of_bedrooms', $_POST['fields']['field_55e57136adc2e']);
}
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.