Description

Action fires immediately after a new user is registered.

Parameters

$user_id
(int) User ID of the current viewer, or 0 if the current viewer is not logged in.
$fields
(array) Sanitized entry field values/properties.
$form_data
(array) Processed form settings/data, prepared to be used later.
$userdata
(array) WP_User object with the information pertaining to the user whose ID is passed.

Source

wpforms-user-registration/class-user-registration.php

More Information

This action is called immediately after a new user is registered through the WPForms User Registration addon.

Examples

Just remember to change the form ID from 5 to match your form ID.

/**
 * Action that fires just after the submit button is clicked on user registration form.
 * 
 * @link  https://wpforms.com/developers/wpforms_user_registered/
 * 
 * @param int    $user_id    User ID of the current viewer.
 * @param array  $fields     Original $_POST global.
 * @param array  $form_data  Form data and settings.
 * @param int    $userdata   WP_User object with information from user ID.
 */

function wpf_dev_user_registered( $user_id, $fields, $form_data, $userdata ) {
    // Only run on my form with ID = 5
    if ( absint( $form_data['id'] ) !== 5 ) {
            return;
        } 
         
    // Run code.

}
add_action( 'wpforms_user_registered', 'wpf_dev_user_registered', 10, 4 );

Snippet Reference: How to Install and Set Up User Registration Addon with WPForms