Automattic\WooCommerce\Internal\Features

FeaturesController::feature_enable_option_name()publicWC 1.0

Get the name of the option that enables/disables a given feature.

Note that it doesn't check if the feature actually exists. Instead it defaults to "woocommerce_feature_{$feature_id}_enabled" if a different name isn't specified in the feature registration.

Method of the class: FeaturesController{}

No Hooks.

Return

String. The option that enables or disables the feature.

Usage

$FeaturesController = new FeaturesController();
$FeaturesController->feature_enable_option_name( $feature_id ): string;
$feature_id(string) (required)
The id of the feature.

FeaturesController::feature_enable_option_name() code WC 8.7.0

public function feature_enable_option_name( string $feature_id ): string {
	$features = $this->get_feature_definitions();

	if ( ! empty( $features[ $feature_id ]['option_key'] ) ) {
		return $features[ $feature_id ]['option_key'];
	}

	return "woocommerce_feature_{$feature_id}_enabled";
}