woocommerce_geolocation_ajax_get_location_hash filter-hookWC 3.6.0

Controls the location hash used in geolocation-based caching.

Usage

add_filter( 'woocommerce_geolocation_ajax_get_location_hash', 'wp_kama_woocommerce_geolocation_ajax_get_location_hash_filter', 10, 3 );

/**
 * Function for `woocommerce_geolocation_ajax_get_location_hash` filter-hook.
 * 
 * @param string      $location_hash The hash used for geolocation.
 * @param array       $location      The location/address data.
 * @param WC_Customer $customer      The current customer object.
 *
 * @return string
 */
function wp_kama_woocommerce_geolocation_ajax_get_location_hash_filter( $location_hash, $location, $customer ){

	// filter...
	return $location_hash;
}
$location_hash(string)
The hash used for geolocation.
$location(array)
The location/address data.
$customer(WC_Customer)
The current customer object.

Changelog

Since 3.6.0 Introduced.

Where the hook is called

WC_Cache_Helper::geolocation_ajax_get_location_hash()
woocommerce_geolocation_ajax_get_location_hash
woocommerce/includes/class-wc-cache-helper.php 143
return apply_filters( 'woocommerce_geolocation_ajax_get_location_hash', $location_hash, $location, $customer );

Where the hook is used in WooCommerce

Usage not found.