WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

WC_Integration_MaxMind_Geolocation::update_database() public WC 1.0

Updates the database used for geolocation queries.

{} Это метод класса: WC_Integration_MaxMind_Geolocation{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$WC_Integration_MaxMind_Geolocation = new WC_Integration_MaxMind_Geolocation();
$WC_Integration_MaxMind_Geolocation->update_database( $new_database_path );
$new_database_path(строка/null)
The path to the new database file. Null will fetch a new archive.
По умолчанию: null

Код WC_Integration_MaxMind_Geolocation::update_database() WC 4.7.1

<?php
public function update_database( $new_database_path = null ) {
	// Allow us to easily interact with the filesystem.
	require_once ABSPATH . 'wp-admin/includes/file.php';
	WP_Filesystem();
	global $wp_filesystem;

	// Remove any existing archives to comply with the MaxMind TOS.
	$target_database_path = $this->database_service->get_database_path();

	// If there's no database path, we can't store the database.
	if ( empty( $target_database_path ) ) {
		return;
	}

	if ( $wp_filesystem->exists( $target_database_path ) ) {
		$wp_filesystem->delete( $target_database_path );
	}

	if ( isset( $new_database_path ) ) {
		$tmp_database_path = $new_database_path;
	} else {
		// We can't download a database if there's no license key configured.
		$license_key = $this->get_option( 'license_key' );
		if ( empty( $license_key ) ) {
			return;
		}

		$tmp_database_path = $this->database_service->download_database( $license_key );
		if ( is_wp_error( $tmp_database_path ) ) {
			wc_get_logger()->notice( $tmp_database_path->get_error_message(), array( 'source' => 'maxmind-geolocation' ) );
			return;
		}
	}

	// Move the new database into position.
	$wp_filesystem->move( $tmp_database_path, $target_database_path, true );
	$wp_filesystem->delete( dirname( $tmp_database_path ) );
}