woocommerce_new_customer_username хук-фильтрWC 3.7.0

Filter new customer username.

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

add_filter( 'woocommerce_new_customer_username', 'wp_kama_woocommerce_new_customer_username_filter', 10, 4 );

/**
 * Function for `woocommerce_new_customer_username` filter-hook.
 * 
 * @param string $username      Customer username.
 * @param string $email         New customer email address.
 * @param array  $new_user_args Array of new user args, maybe including first and last names.
 * @param string $suffix        Append string to username to make it unique.
 *
 * @return string
 */
function wp_kama_woocommerce_new_customer_username_filter( $username, $email, $new_user_args, $suffix ){

	// filter...
	return $username;
}
$username(строка)
Customer username.
$email(строка)
New customer email address.
$new_user_args(массив)
Array of new user args, maybe including first and last names.
$suffix(строка)
Append string to username to make it unique.

Список изменений

С версии 3.7.0 Введена.

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

wc_create_new_customer_username()
woocommerce_new_customer_username
woocommerce/includes/wc-user-functions.php 221
return apply_filters( 'woocommerce_new_customer_username', $username, $email, $new_user_args, $suffix );

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

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