woocommerce_get_country_locale_default │ хук-фильтр │ WC 1.5.4

Filters the default address field settings, which get_address_fields() uses for countries without their own.

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

add_filter( 'woocommerce_get_country_locale_default', 'wp_kama_woocommerce_get_country_locale_default_filter' );

/**
 * Function for `woocommerce_get_country_locale_default` filter-hook.
 * 
 * @param array $fields Default address field settings.
 *
 * @return array
 */
function wp_kama_woocommerce_get_country_locale_default_filter( $fields ){
	// filter...
	return $fields;
}
$fields(массив)
Default address field settings.

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

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

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

WC_Countries::get_country_locale()
woocommerce_get_country_locale_default
woocommerce/includes/class-wc-countries.php 1910
$locale['default'] = apply_filters( 'woocommerce_get_country_locale_default', $this->get_default_address_fields() );

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

woocommerce/src/Blocks/Domain/Services/CheckoutFields.php 117
add_filter( 'woocommerce_get_country_locale_default', array( $this, 'update_default_locale_with_fields' ) );