<?php
/**
* FeaturesUtil class file.
*/
namespace Automattic\WooCommerce\Utilities;
use Automattic\WooCommerce\Internal\Features\FeaturesController;
/**
* Class with methods that allow to retrieve information about the existing WooCommerce features,
* also has methods for WooCommerce plugins to declare (in)compatibility with the features.
*/
class FeaturesUtil {
/**
* Get all the existing WooCommerce features.
*
* Returns an associative array where keys are unique feature ids
* and values are arrays with these keys:
*
* - name
* - description
* - is_experimental
* - is_enabled (if $include_enabled_info is passed as true)
*
* @param bool $include_experimental Include also experimental/work in progress features in the list.
* @param bool $include_enabled_info True to include the 'is_enabled' field in the returned features info.
* @returns array An array of information about existing features.
*/
public static function get_features( bool $include_experimental = false, bool $include_enabled_info = false ): array {
return wc_get_container()->get( FeaturesController::class )->get_features( $include_experimental, $include_enabled_info );
}
/**
* Check if a given feature is currently enabled.
*
* @param string $feature_id Unique feature id.
* @return bool True if the feature is enabled, false if not or if the feature doesn't exist.
*/
public static function feature_is_enabled( string $feature_id ): bool {
return wc_get_container()->get( FeaturesController::class )->feature_is_enabled( $feature_id );
}
/**
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX