Deprecated the WC_Geolocation::get_local_database_path method
This commit is contained in:
parent
f91ff82806
commit
2df3af1e63
|
@ -194,7 +194,7 @@ class WC_Geolocation {
|
|||
$country_code = strtoupper( sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_COUNTRY_CODE'] ) ) ); // WPCS: input var ok, CSRF ok.
|
||||
} else {
|
||||
$ip_address = $ip_address ? $ip_address : self::get_ip_address();
|
||||
$database = self::get_local_database_path();
|
||||
$database = WC_Integration_MaxMind_Geolocation_Database::get_database_path();
|
||||
|
||||
if ( file_exists( $database ) ) {
|
||||
$country_code = self::geolocate_via_db( $ip_address, $database );
|
||||
|
@ -220,11 +220,12 @@ class WC_Geolocation {
|
|||
/**
|
||||
* Path to our local db.
|
||||
*
|
||||
* @deprecated 3.9.0
|
||||
* @param string $deprecated Deprecated since 3.4.0.
|
||||
* @return string
|
||||
*/
|
||||
public static function get_local_database_path( $deprecated = '2' ) {
|
||||
require_once WC_ABSPATH . 'includes/integrations/maxmind-geolocation/class-wc-integration-maxmind-geolocation-database.php';
|
||||
wc_deprecated_function( 'WC_Geolocation::get_local_database_path', '3.9.0' );
|
||||
return WC_Integration_MaxMind_Geolocation_Database::get_database_path();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue