woocommerce_new_customer_data
Filters customer data before a customer account is registered.
This hook filters customer data. It allows user data to be changed, for example, username, password, email, first name, last name, and role.
Использование
add_filter( 'woocommerce_new_customer_data', 'wp_kama_woocommerce_new_customer_data_filter' ); /** * Function for `woocommerce_new_customer_data` filter-hook. * * @param array $customer_data An array of customer (user) data. * * @return array */ function wp_kama_woocommerce_new_customer_data_filter( $customer_data ){ // filter... return $customer_data; }
- $customer_data(массив)
- An array of customer (user) data.
Список изменений
С версии 7.2.0 | Введена. |
Где вызывается хук
woocommerce_new_customer_data
woocommerce/includes/wc-user-functions.php 162-172
$new_customer_data = apply_filters( 'woocommerce_new_customer_data', wp_parse_args( $customer_data, array( 'first_name' => '', 'last_name' => '', 'source' => 'unknown', ) ) );