ip-location-block-xxxxx-status

May 11, 2021
Darko G.

The HTTP status code when the blocking occurs.

Description

The filter hook “ip-location-block-xxxxx-status” where xxxxx is one of comment, xmlrpc, login, admin and public assigns the HTTP status code when the blocking occurs.

Parameters

  • $code
    (int) “Response code” in “Validation rule settings” section.

Use case

The following code in your functions.php can hide your login page.

function my_login_status ( $code ) {
    return 404;
}
add_filter( 'ip-location-block-login-status', 'my_login_status' );

The status code 404 leads to the “404 page” in your theme. For example, the following picture shows the page of Twenty Twelve.

404 error page

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