Quantcast
Channel: Codex – IP Location Block
Viewing all articles
Browse latest Browse all 9

ip-location-block-xxxxx-reason

$
0
0

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


Viewing all articles
Browse latest Browse all 9

Trending Articles