woocommerce_states
Allows filtering of country states in WC.
Использование
add_filter( 'woocommerce_states', 'wp_kama_woocommerce_states_filter' );
/**
* Function for `woocommerce_states` filter-hook.
*
* @param array $states
*
* @return array
*/
function wp_kama_woocommerce_states_filter( $states ){
// filter...
return $states;
}
- $states(массив)
- -
Список изменений
| С версии 1.5.3 | Введена. |
Где вызывается хук
woocommerce_states
woocommerce_states
woocommerce/includes/class-wc-countries.php 222
$this->geo_cache['states'] = apply_filters( 'woocommerce_states', $states );
woocommerce/includes/class-wc-countries.php 240
$this->geo_cache['states'] = apply_filters( 'woocommerce_states', include WC()->plugin_path() . '/i18n/states.php' );