Automattic\WooCommerce\Admin\Features\MarketingRecommendations
Init::is_marketing_channel_plugin
Returns whether a plugin is a marketing channel.
Method of the class: Init{}
No Hooks.
Returns
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() Init::is marketing channel plugin code WC 10.5.0
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;
}