Skip to content

ip-location-block-geolite2-dir


Looking for current setup instructions?

The Codex is preserved as a legacy and developer reference. The current interface is documented in the new guides.

Open current guide

The absolute path to the directory where MaxMind GeoLite2 database is installed.

Description

The filter hook “ip-location-block-geolite2-dir” assigns the absolute path to the directory where the GeoLite2 Free Downloadable Database is installed.

Parameters

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

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_geolite2_dir( $dir ) {
    $upload = wp_upload_dir();
    return $upload['basedir'];
}
add_filter( 'ip-location-block-geolite2-dir', 'my_geolite2_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.0.3.0.17

All Legacy Codex entries