Closed mcolomer closed 6 years ago
Hi @mcolomer ,
I hope the following code snippet can help you.
$settings = IP_Geo_Block::get_option();
$validate = IP_Geo_Block::get_geolocation();
$validate = IP_Geo_Block::validate_country( 'public', validate, $settings['public'] );
if ( 'passed' === $validate['result'] ) {
// do stuff;
}
Please find Example 17 about IP_Geo_Block::get_geolocation()
.
Thank you tokko.
It works like a charm.
Best,
Good, and one thing I should add to avoid error just in case:
if ( class_exists( 'IP_Geo_Block' ) ) {
// the above code snippet here;
} else {
// do full stuff here;
}
Hi,
I have detected that a blocked post appears in blog list but a not found page is shown when you click on it. Is there any fast way to fix this by myself?
I would like to avoid showing blocked post in blog list page to avoid noise for end user.
Best,