woocommerce_get_geolocation хук-фильтр . WC 3.9.0
Get geolocation filter.
Использование
add_filter( 'woocommerce_get_geolocation', 'filter_function_name_8020', 10, 2 ); function filter_function_name_8020( $geolocation, $ip_address ){ // filter... return $geolocation; }
- $geolocation(массив)
- Geolocation data, including country, state, city, and postcode.
- $ip_address(строка)
- IP Address.
Список изменений
С версии 3.9.0 | Введена. |
Где вызывается хук
woocommerce_get_geolocation
woocommerce/includes/class-wc-geolocation.php 164-173
$geolocation = apply_filters( 'woocommerce_get_geolocation', array( 'country' => $country_code, 'state' => '', 'city' => '', 'postcode' => '', ), $ip_address );
Где используется хук в ядре WooCommerce
woocommerce/includes/class-wc-geolocation.php 83
add_filter( 'woocommerce_get_geolocation', array( $this, 'get_geolocation' ), 10, 2 );