Added support for non-standard upload folder paths

This commit is contained in:
Christopher Allford 2020-01-13 11:00:23 -08:00
parent 6d3a3053c5
commit 48d819ebeb
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,9 @@ class WC_Integration_MaxMind_Database_Service {
* @return string The local database path.
*/
public function get_database_path() {
$database_path = WP_CONTENT_DIR . '/uploads/woocommerce_uploads/';
$uploads_dir = wp_upload_dir();
$database_path = trailingslashit( $uploads_dir['basedir'] ) . 'woocommerce_uploads/';
if ( ! empty( $this->database_prefix ) ) {
$database_path .= $this->database_prefix . '-';
}