WordPress at Your Fingertips
function is not described

WC_Integration_MaxMind_Geolocation::display_missing_license_key_notice() public WC 1.0

Display notice if license key is missing.

{} It's a method of the class: WC_Integration_MaxMind_Geolocation{}

Return

null. Nothing.

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.

Code of WC_Integration_MaxMind_Geolocation::display_missing_license_key_notice() WC 5.9.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();
}