woocommerce_after_save_address_validation
Hook: woocommerce_after_save_address_validation.
Allow developers to add custom validation logic and throw an error to prevent save.
Использование
add_action( 'woocommerce_after_save_address_validation', 'wp_kama_woocommerce_after_save_address_validation_action', 10, 4 );
/**
* Function for `woocommerce_after_save_address_validation` action-hook.
*
* @param int $user_id User ID being saved.
* @param string $address_type Type of address; 'billing' or 'shipping'.
* @param array $address The address fields.
* @param WC_Customer $customer The customer object being saved.
*
* @return void
*/
function wp_kama_woocommerce_after_save_address_validation_action( $user_id, $address_type, $address, $customer ){
// action...
}
- $user_id(int)
- User ID being saved.
- $address_type(строка)
- Type of address; 'billing' or 'shipping'.
- $address(массив)
- The address fields.
- $customer(WC_Customer)
- The customer object being saved.
Список изменений
| С версии 3.6.0 | Введена. |
Где вызывается хук
woocommerce_after_save_address_validation
woocommerce/includes/class-wc-form-handler.php 204
do_action( 'woocommerce_after_save_address_validation', $user_id, $address_type, $address, $customer );