Automattic\WooCommerce\Admin\Features
Features::disable
Deprecated since 1.1.0. It is no longer supported and may be removed in future releases. Use
FeaturesUtil::feature_is_enabled() to check if a feature is enabled instead.Disable a toggleable optional feature.
Method of the class: Features{}
No Hooks.
Returns
bool.
Usage
$result = Features::disable( $feature );
- $feature(string) (required)
- Feature name.
Changelog
| Deprecated since 11.1.0 | Use FeaturesUtil::feature_is_enabled() to check if a feature is enabled. |
Features::disable() Features::disable code WC 11.3.0
public static function disable( $feature ) {
wc_deprecated_function( __METHOD__, '11.1.0', 'FeaturesUtil::feature_is_enabled()' );
if ( 'analytics' === $feature ) {
update_option( Analytics::TOGGLE_OPTION_NAME, 'no' );
return true;
}
if ( 'remote-inbox-notifications' === $feature ) {
update_option( RemoteInboxNotifications::TOGGLE_OPTION_NAME, 'no' );
return true;
}
return false;
}