WC_Integration_MaxMind_Geolocation::display_missing_license_key_notice()publicWC 1.0

Display notice if license key is missing.

Method of the class: WC_Integration_MaxMind_Geolocation{}

Return

null. Nothing (null).

Usage

$WC_Integration_MaxMind_Geolocation = new WC_Integration_MaxMind_Geolocation();
$WC_Integration_MaxMind_Geolocation->display_missing_license_key_notice( $old_value, $new_value );
$old_value(mixed) (required)
Option old value.
$new_value(mixed) (required)
Current value.

WC_Integration_MaxMind_Geolocation::display_missing_license_key_notice() code WC 8.6.1

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();
}