Use wp_get_upload_dir for geolite DB path

By default, `wp_upload_dir` will "will create a subfolder in your Uploads folder corresponding to the queried month (or current month, if no $time argument is provided" (https://developer.wordpress.org/reference/functions/wp_upload_dir/).

This is not necessary in our case since all we want is the `basedir` value.

We're switching to `wp_get_upload_dir`, which is a wrapper for `wp_upload_dir` that turns of the folder create behaviour.
This commit is contained in:
Mohammad Jangda 2018-10-13 01:27:45 -04:00 committed by GitHub
parent 74693979db
commit 0590522180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class WC_Geolocation {
* @return string * @return string
*/ */
public static function get_local_database_path( $deprecated = '2' ) { public static function get_local_database_path( $deprecated = '2' ) {
$upload_dir = wp_upload_dir(); $upload_dir = wp_get_upload_dir();
return apply_filters( 'woocommerce_geolocation_local_database_path', $upload_dir['basedir'] . '/GeoLite2-Country.mmdb', $deprecated ); return apply_filters( 'woocommerce_geolocation_local_database_path', $upload_dir['basedir'] . '/GeoLite2-Country.mmdb', $deprecated );
} }