acf_pro_update_license_option()ACF 6.2.6

Updates a multisite compatible licensing data value For multisite installs, this is from the main site options if available or the normal option otherwise.

No Hooks.

Returns

boolean. True if the value was updated, false otherwise.

Usage

acf_pro_update_license_option( $option_name, $value, $autoload );
$option_name(string) (required)
The option name to update.
$value(mixed)
The new value to set.
Default: false
$autoload(true|false)
True if the option should be autoloaded.
Default: false

Changelog

Since 6.2.6 Introduced.

acf_pro_update_license_option() code ACF 6.8.8

function acf_pro_update_license_option( $option_name, $value = false, $autoload = false ) {
	if ( acf_pro_is_legacy_multisite() ) {
		$main_site_id = get_main_site_id();
		if ( $main_site_id !== get_current_blog_id() ) {
			switch_to_blog( $main_site_id );
			$return = update_option( $option_name, $value, $autoload );
			restore_current_blog();
			return $return;
		}
	}

	return update_option( $option_name, $value, $autoload );
}