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
- $msg
(string)get_status_header_desc()
Use case
The following picture shows a human readble message when a blocking occurs.
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