woocommerce_set_additional_field_value action-hookWC 8.9.0

Allow reacting for saving an additional field value.

Usage

add_action( 'woocommerce_set_additional_field_value', 'wp_kama_woocommerce_set_additional_field_value_action', 10, 4 );

/**
 * Function for `woocommerce_set_additional_field_value` action-hook.
 * 
 * @param string               $key       The key of the field being saved.
 * @param mixed                $value     The value of the field being saved.
 * @param string               $group     The group of this location (shipping|billing|other).
 * @param WC_Customer|WC_Order $wc_object The object to set the field value for.
 *
 * @return void
 */
function wp_kama_woocommerce_set_additional_field_value_action( $key, $value, $group, $wc_object ){

	// action...
}
$key(string)
The key of the field being saved.
$value(mixed)
The value of the field being saved.
$group(string)
The group of this location (shipping|billing|other).
$wc_object(WC_Customer|WC_Order)
The object to set the field value for.

Changelog

Since 8.9.0 Introduced.

Where the hook is called

CheckoutFields::set_array_meta()
woocommerce_set_additional_field_value
woocommerce/src/Blocks/Domain/Services/CheckoutFields.php 1092
do_action( 'woocommerce_set_additional_field_value', $key, $value, $group, $wc_object );

Where the hook is used in WooCommerce

Usage not found.