woocommerce_register_post action-hookWC 7.2.0

Fires before a customer account is registered.

This hook fires before customer accounts are created and passes the form data (username, email) and an array of errors.

This could be used to add extra validation logic and append errors to the array.

Usage

add_action( 'woocommerce_register_post', 'wp_kama_woocommerce_register_post_action', 10, 3 );

/**
 * Function for `woocommerce_register_post` action-hook.
 * 
 * @param string    $username   Customer username.
 * @param string    $user_email Customer email address.
 * @param \WP_Error $errors     Error object.
 *
 * @return void
 */
function wp_kama_woocommerce_register_post_action( $username, $user_email, $errors ){

	// action...
}
$username(string)
Customer username.
$user_email(string)
Customer email address.
$errors(\WP_Error)
Error object.

Changelog

Since 7.2.0 Introduced.

Where the hook is called

Checkout::create_customer_account()
woocommerce_register_post
wc_create_new_customer()
woocommerce_register_post
woocommerce/src/StoreApi/Routes/V1/Checkout.php 638
do_action( 'woocommerce_register_post', $username, $user_email, $errors );
woocommerce/includes/wc-user-functions.php 88
do_action( 'woocommerce_register_post', $username, $email, $errors );

Where the hook is used in WooCommerce

Usage not found.