Automattic\WooCommerce\Internal\Features

FeaturesController::change_feature_enable()publicWC 1.0

Change the enabled/disabled status of a feature.

{} Это метод класса: FeaturesController{}

Хуков нет.

Возвращает

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

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

$FeaturesController = new FeaturesController();
$FeaturesController->change_feature_enable( $feature_id, $enable ): bool;
$feature_id(строка) (обязательный)
Unique feature id.
$enable(true|false) (обязательный)
True to enable the feature, false to disable it.

Код FeaturesController::change_feature_enable() WC 7.1.0

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' );
}