Support

Account

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;