woocommerce_geolocate_ip

The WooCommerce woocommerce geolocate ip hook.

Description

apply_filters( 'woocommerce_geolocate_ip', (bool) $false, (unknown) $ip_address, (unknown) $fallback, (unknown) $api_fallback ); 

Parameters (4)

0. $false (bool) => false
The false.
1. $ip_address (unknown)
The ip address.
2. $fallback (unknown)
The fallback.
3. $api_fallback (unknown)
The api fallback.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'woocommerce_geolocate_ip', $false, $ip_address, $fallback, $api_fallback ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_geolocate_ip callback 
  2. function filter_woocommerce_geolocate_ip( $false, $ip_address, $fallback, $api_fallback ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_geolocate_ip', 'filter_woocommerce_geolocate_ip', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_geolocate_ip', 'filter_woocommerce_geolocate_ip', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-wc-geolocation.php  
  1. $country_code = apply_filters( 'woocommerce_geolocate_ip', false, $ip_address, $fallback, $api_fallback );