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:
parent
74693979db
commit
0590522180
|
@ -237,7 +237,7 @@ class WC_Geolocation {
|
|||
* @return string
|
||||
*/
|
||||
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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue