The IP address of the server for the current requester.
The filter hook “ip-geo-block-ip-addr” assigns the IP address from which the current request comes. This plugin validate it by means of the country code and black / white list of extra IPs.
$_SERVER['REMOTE_ADDR']
The following code snippet in your theme’s functions.php
can replace the IP
address according to your browser’s user agent string. It’s useful to test
this plugin’s functionality using browser’s addon which can be
change the user agent string.
function my_replace_ip( $ip ) {
if ( FALSE !== stripos( $_SERVER['HTTP_USER_AGENT'], 'your unique string' ) )
return '98.139.183.24'; // yahoo.com
else
return $ip;
}
add_filter( 'ip-geo-block-ip-addr', 'my_replace_ip' );
"mu-plugins" (ip-geo-block-mu.php)
as
Validation timing
, you should put your code snippet into drop-in.php
in
Geolocation API folder
instead of functions.php
. See
My custom functions in “functions.php” doesn’t work.
in FAQ for detail.
1.2.0