ip-location-block-xxxxx-reason

May 11, 2021
Darko G.

The message of the reason when the blocking occurs.

Description

The filter hook “ip-location-block-xxxxx-reason” where xxxxx is one of comment, xmlrpc, login, admin and public assigns the human readable message according to the “Response code” on “Validation rule settings” when the blocking occurs.

Parameters

Use case

The following picture shows a human readble message when a blocking occurs.

403 error page

You can change the message “Forbidden” as follows:

function my_comment_reason ( $msg ) {
    return "Sorry, this service is unavailable.";
}
add_filter( 'ip-location-block-comment-reason',  'my_comment_reason'  );
NOTE: When you select "mu-plugins" (ip-location-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.

Since

0.2.1.1

Leave a Reply

Your email address will not be published.

© 2022 - IP Location Block by IDEOLOGIX Media