woocommerce_valid_location_types
Is passed location type valid?
Использование
add_filter( 'woocommerce_valid_location_types', 'wp_kama_woocommerce_valid_location_types_filter' ); /** * Function for `woocommerce_valid_location_types` filter-hook. * * @param string $type Type to check. * * @return string */ function wp_kama_woocommerce_valid_location_types_filter( $type ){ // filter... return $type; }
- $type(строка)
- Type to check.
Где вызывается хук
woocommerce_valid_location_types
woocommerce/includes/class-wc-shipping-zone.php 354
return in_array( $type, apply_filters( 'woocommerce_valid_location_types', array( 'postcode', 'state', 'country', 'continent' ) ), true );