WC_Integration_MaxMind_Database_Service::get_database_path
Fetches the path that the database should be stored.
Method of the class: WC_Integration_MaxMind_Database_Service{}
Hooks from the method
Returns
String. The local database path.
Usage
$WC_Integration_MaxMind_Database_Service = new WC_Integration_MaxMind_Database_Service(); $WC_Integration_MaxMind_Database_Service->get_database_path();
WC_Integration_MaxMind_Database_Service::get_database_path() WC Integration MaxMind Database Service::get database path code WC 10.6.2
public function get_database_path() {
$uploads_dir = wp_upload_dir();
$database_path = trailingslashit( $uploads_dir['basedir'] ) . 'woocommerce_uploads/';
if ( ! empty( $this->database_prefix ) ) {
$database_path .= $this->database_prefix . '-';
}
$database_path .= self::DATABASE . self::DATABASE_EXTENSION;
/**
* Filter the geolocation database storage path.
*
* @param string $database_path The path to the database.
* @param int $version Deprecated since 3.4.0.
* @deprecated 3.9.0
*/
$database_path = apply_filters_deprecated(
'woocommerce_geolocation_local_database_path',
array( $database_path, 2 ),
'3.9.0',
'woocommerce_maxmind_geolocation_database_path'
);
/**
* Filter the geolocation database storage path.
*
* @since 3.9.0
* @param string $database_path The path to the database.
*/
return apply_filters( 'woocommerce_maxmind_geolocation_database_path', $database_path );
}