ACF\Site_Health

Site_Health::add_activation_eventpublicACF 6.3

Logs activation events for free/pro.

Method of the class: Site_Health{}

No Hooks.

Returns

true|false.

Usage

$Site_Health = new Site_Health();
$Site_Health->add_activation_event();

Changelog

Since 6.3 Introduced.

Site_Health::add_activation_event() code ACF 6.8.8

public function add_activation_event() {
	$event_name = 'first_activated';

	if ( acf_is_pro() ) {
		$event_name = 'first_activated_pro';

		if ( 'acf/first_activated' !== current_filter() ) {
			$site_health = $this->get_site_health();

			/**
			 * We already have an event for when pro was first activated,
			 * so we don't need to log an additional event here.
			 */
			if ( ! empty( $site_health[ 'event_' . $event_name ] ) ) {
				return false;
			}

			$event_name = 'activated_pro';
		}
	}

	return $this->add_site_health_event( $event_name );
}