Automattic\WooCommerce\Internal\Features

FeaturesController::change_feature_enable()publicWC 1.0

Change the enabled/disabled status of a feature.

Method of the class: FeaturesController{}

No Hooks.

Return

true|false. True on success, false if feature doesn't exist or the new value is the same as the old value.

Usage

$FeaturesController = new FeaturesController();
$FeaturesController->change_feature_enable( $feature_id, $enable ): bool;
$feature_id(string) (required)
Unique feature id.
$enable(true|false) (required)
True to enable the feature, false to disable it.

FeaturesController::change_feature_enable() code WC 8.6.1

public function change_feature_enable( string $feature_id, bool $enable ): bool {
	if ( ! $this->feature_exists( $feature_id ) ) {
		return false;
	}

	return update_option( $this->feature_enable_option_name( $feature_id ), $enable ? 'yes' : 'no' );
}