woocommerce_customer_default_location

woocommerce_customer_default_location

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

apply_filters('woocommerce_customer_default_location') is found 1 times:

  • /includes/wc-core-functions.php line 1321
     */
    function wc_get_customer_default_location() {
    	$set_default_location_to = get_option( 'woocommerce_default_customer_address', 'base' );
    	$default_location        = '' === $set_default_location_to ? '' : get_option( 'woocommerce_default_country', 'US:CA' );
    	$location                = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', $default_location ) );
    
    	// Geolocation takes priority if used and if geolocation is possible.
    	if ( 'geolocation' === $set_default_location_to || 'geolocation_ajax' === $set_default_location_to ) {
    		$ua = wc_get_user_agent();
    
    		// Exclude common bots from geolocation by user agent.