woocommerce_register_post
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
woocommerce_register_post
woocommerce/includes/wc-user-functions.php 117
do_action( 'woocommerce_register_post', $username, $email, $errors );