woocommerce_blocks_validate_location_(location)_fields action-hookWC 8.7.0

Pass an error object to allow validation of an additional field.

Usage

add_action( 'woocommerce_blocks_validate_location_(location)_fields', 'wp_kama_woocommerce_blocks_validate_location_fields_action', 10, 3 );

/**
 * Function for `woocommerce_blocks_validate_location_(location)_fields` action-hook.
 * 
 * @param WP_Error $errors A WP_Error object that extensions may add errors to.
 * @param mixed    $fields List of fields (key value pairs) in this location.
 * @param string   $group  The group of this location (shipping|billing|other).
 *
 * @return void
 */
function wp_kama_woocommerce_blocks_validate_location_fields_action( $errors, $fields, $group ){

	// action...
}
$errors(WP_Error)
A WP_Error object that extensions may add errors to.
$fields(mixed)
List of fields (key value pairs) in this location.
$group(string)
The group of this location (shipping|billing|other).

Changelog

Since 8.7.0 Introduced.

Where the hook is called

CheckoutFields::validate_fields_for_location()
woocommerce_blocks_validate_location_(location)_fields
woocommerce/src/Blocks/Domain/Services/CheckoutFields.php 905
do_action( 'woocommerce_blocks_validate_location_' . $location . '_fields', $errors, $fields, $group );

Where the hook is used in WooCommerce

Usage not found.