woocommerce_register_post хук-событиеWC 1.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.

Использование

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(строка)
Customer username.
$user_email(строка)
Customer email address.
$errors(\WP_Error)
Error object.

Где вызывается хук

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

Где используется хук в WooCommerce

Использование не найдено.