woocommerce_states
Allows filtering of country states in WC.
Usage
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(array)
- -
Changelog
Since 1.5.3 | Introduced. |
Where the hook is called
woocommerce_states
woocommerce_states
woocommerce/includes/class-wc-countries.php 192
$this->geo_cache['states'] = apply_filters( 'woocommerce_states', $states );
woocommerce/includes/class-wc-countries.php 210
$this->geo_cache['states'] = apply_filters( 'woocommerce_states', include WC()->plugin_path() . '/i18n/states.php' );