Automattic\WooCommerce\Admin\Features

Features::exists │ public static │ WC 1.0

Returns if a specific wc-admin feature exists in the current environment.

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

Хуков нет.

Возвращает

bool. Returns true if the feature exists.

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

$result = Features::exists( $feature );
$feature(строка) (обязательный)
Feature slug.

Код Features::exists() WC 11.2.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 );
}