acf_pro_update_license()ACF 5.4.0

This function will update the DB license

Хуков нет.

Возвращает

true|false. The result of the update_option call

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

acf_pro_update_license( $key );
$key(строка)
The license key
По умолчанию: ''

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

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

Код acf_pro_update_license() ACF 6.0.4

function acf_pro_update_license( $key = '' ) {

	// vars
	$value = '';

	// key
	if ( $key ) {

		// vars
		$data = array(
			'key' => $key,
			'url' => acf_get_home_url(),
		);

		// encode
		$value = base64_encode( maybe_serialize( $data ) );

	}

	// re-register update (key has changed)
	acf_register_plugin_update(
		array(
			'id'       => 'pro',
			'key'      => $key,
			'slug'     => acf_get_setting( 'slug' ),
			'basename' => acf_get_setting( 'basename' ),
			'version'  => acf_get_setting( 'version' ),
		)
	);

	// update
	return update_option( 'acf_pro_license', $value );

}