|

srfm_cdn_country

Description

Filters the visitor country resolved from a CDN header (e.g. Cloudflare). Return a 2-letter country code to short-circuit IP-based geolocation.

Parameters

  • $country (string) – The country code (defaults to ”).

Filter Source

PHP
/**
* filter source (Free) inc/helper.php 
*/
$country = apply_filters( 'srfm_cdn_country', '' );

Filter Usage

PHP
add_filter( 'srfm_cdn_country', 'my_callback', 10, 1 ); 
function my_callback( $country ) { 
return $country; 
}

Filter Example

PHP
add_filter( 'srfm_cdn_country', 'my_callback', 10, 1 ); 
function my_callback( $country ) { 
return $country; 
}
Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top