WC_Integration_MaxMind_Geolocation::display_missing_license_key_notice()publicWC 1.0

Display notice if license key is missing.

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

Возвращает

null. Ничего (null).

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

$WC_Integration_MaxMind_Geolocation = new WC_Integration_MaxMind_Geolocation();
$WC_Integration_MaxMind_Geolocation->display_missing_license_key_notice( $old_value, $new_value );
$old_value(разное) (обязательный)
Option old value.
$new_value(разное) (обязательный)
Current value.

Код WC_Integration_MaxMind_Geolocation::display_missing_license_key_notice() WC 8.7.0

public function display_missing_license_key_notice( $old_value, $new_value ) {
	if ( ! apply_filters( 'woocommerce_maxmind_geolocation_display_notices', true ) ) {
		return;
	}

	if ( ! in_array( $new_value, array( 'geolocation', 'geolocation_ajax' ), true ) ) {
		$this->remove_missing_license_key_notice();
		return;
	}

	$license_key = $this->get_option( 'license_key' );
	if ( ! empty( $license_key ) ) {
		return;
	}

	$this->add_missing_license_key_notice();
}