Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Marketing::has_installed_extensions()public staticWC 1.0

Check if the store has installed marketing extensions.

Method of the class: Marketing{}

No Hooks.

Return

true|false.

Usage

$result = Marketing::has_installed_extensions();

Marketing::has_installed_extensions() code WC 7.1.1

public static function has_installed_extensions() {
	$plugins   = self::get_plugins();
	$remaining = array();
	$installed = array();

	foreach ( $plugins as $plugin ) {
		if ( ! $plugin->is_installed ) {
			$remaining[] = $plugin;
		} else {
			$installed[] = $plugin;
		}
	}

	// Make sure the task has been actioned and a marketing extension has been installed.
	if ( count( $installed ) > 0 && Task::is_task_actioned( 'marketing' ) ) {
		return true;
	}

	return false;
}