Automattic\WooCommerce\Admin\Features
Features::exists
Returns if a specific wc-admin feature exists in the current environment.
Method of the class: Features{}
No Hooks.
Returns
bool. Returns true if the feature exists.
Usage
$result = Features::exists( $feature );
- $feature(string) (required)
- Feature slug.
Features::exists() Features::exists code WC 11.1.2
public static function exists( $feature ) {
$is_legacy_compatibility_feature = self::is_legacy_compatibility_feature( $feature );
if ( $is_legacy_compatibility_feature ) {
self::warn_legacy_feature_compatibility_usage( __METHOD__, $feature );
}
$features = $is_legacy_compatibility_feature
? self::get_features_with_legacy_compatibility_defaults()
: self::get_features();
return in_array( $feature, $features, true );
}