Automattic\WooCommerce\Internal\Admin\Marketing

MarketingSpecs::is_marketing_plugin()protectedWC 1.0

Returns whether a plugin is a marketing extension.

Метод класса: MarketingSpecs{}

Хуков нет.

Возвращает

true|false.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->is_marketing_plugin( $plugin_data ): bool;
$plugin_data(массив) (обязательный)
The plugin properties returned by the API.

Код MarketingSpecs::is_marketing_plugin() WC 8.1.1

protected function is_marketing_plugin( array $plugin_data ): bool {
	$categories = $plugin_data['categories'] ?? [];

	return in_array( self::MARKETING_EXTENSION_CATEGORY_SLUG, $categories, true );
}