ip-location-block-ip2location-dir

Posted on May 11, 2021

The absolute path to the directory where IP2location database is installed.

Description

The filter hook “ip-location-block-ip2location-dir” assigns the absolute path to the directory where the IP2Location geolocation database is installed.

Parameters

  • $dir
    (string) /absolute/path/to/wp-content/ip-geo-api/ip2location

Use case

If you want change it to your /wp-content/uploads/ directory, put the following code snippet into the functions.php in your theme.

function my_ip2location_dir( $dir ) {
    $upload = wp_upload_dir();
    return $upload['basedir'];
}
add_filter( 'ip-location-block-ip2location-dir', 'my_ip2location_dir' );
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.2.1