cf_geoplugin_ip_blocked

This filter modifies the range of IP addresses that are considered bad or you want to block them.

NOTE: Modifying this filter affects the functionality of the entire plugin.

function example_callback( $blocked_ip ) {
	// Maybe modify $blocked_ip in some way.
    return $blocked_ip;
}
add_filter( 'cf_geoplugin_ip_blocked', 'example_callback', 1);

EXAMPLE:

if(!function_exists('change_cf_geoplugin_ip_blocked'))
{
	function change_cf_geoplugin_ip_blocked( $blocked_ip ) {
		// Add new IP adresses what you want to block
		$new_ips = array(
			'192.0.2.0'	=>	24,
			'192.88.99.5'	=>	24,
			'192.168.0.0'	=>	8,
			'192.168.1.0'	=>	255
			// ...
		);
		// Merge it
		return array_merge($blocked_ip, $new_ips);
	}
}
add_filter( 'cf_geoplugin_ip_blocked', 'change_cf_geoplugin_ip_blocked', 1 );
Was this page helpful?