Automattic\WooCommerce\Admin\Features\MarketingRecommendations

Init::is_marketing_channel_plugin()protected staticWC 1.0

Returns whether a plugin is a marketing channel.

Method of the class: Init{}

No Hooks.

Return

true|false.

Usage

$result = Init::is_marketing_channel_plugin( $plugin_data ): bool;
$plugin_data(array) (required)
The plugin properties returned by the API.

Init::is_marketing_channel_plugin() code WC 9.7.1

protected static function is_marketing_channel_plugin( array $plugin_data ): bool {
	if ( ! self::is_marketing_plugin( $plugin_data ) ) {
		return false;
	}

	$subcategories = $plugin_data['subcategories'] ?? array();
	foreach ( $subcategories as $subcategory ) {
		if ( isset( $subcategory['slug'] ) && self::MARKETING_CHANNEL_SUBCATEGORY_SLUG === $subcategory['slug'] ) {
			return true;
		}
	}

	return false;
}