Home › Forums › Front-end Issues › Front-end user registration › Reply To: Front-end user registration
calling acf_form_head()
is required before get_header()
or before any output is created in header.php
. Nothing will be created if you don’t because this function, or functions called by this function is where the apply_filters('acf/pre_save_post'...
is called. Basically, nothing will be saved if this acf_form_head()
is not called.
The only error I see in your filter is
//register user
$user_id = wp_create_user( $username, $password, $email );
//update other user info
wp_update_user( array(
'ID' => $user_id,
'first_name' => $_POST['fields']['field_593642087f8f5'],
'last_name' => $_POST['fields']['field_593642267f8f6'],
'display_name' => $_POST['fields']['field_593642087f8f5'] . ' ' . $_POST['fields']['field_593642267f8f6']
) );
// if you don't want the above fields also saved as custom fields for the user
unset(
$_POST['fields']['field_593642087f8f5'],
$_POST['fields']['field_593642267f8f6'],
$_POST['fields']['field_593642087f8f5'],
$_POST['fields']['field_593642267f8f6']
)
// for ACF, you need to return
return 'user_'.$user_id;
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.