acf_pro_get_license_key()ACF 5.4.0

This function will return the license key

Хуков нет.

Возвращает

Строку. $license_key

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

acf_pro_get_license_key( $skip_url_check );
$skip_url_check(true|false)
Skip the check of the current site url.
По умолчанию: false

Список изменений

С версии 5.4.0 Введена.

Код acf_pro_get_license_key() ACF 6.0.4

function acf_pro_get_license_key( $skip_url_check = false ) {

	$license  = acf_pro_get_license();
	$home_url = acf_get_home_url();

	// bail early if empty
	if ( ! $license || ! $license['key'] ) {
		return false;
	}

	// bail early if url has changed
	if ( ! $skip_url_check && acf_strip_protocol( $license['url'] ) !== acf_strip_protocol( $home_url ) ) {
		return false;
	}

	// return
	return $license['key'];

}