Automattic\WooCommerce\Admin\Features
Features::enable
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.Enable a toggleable optional feature.
Method of the class: Features{}
No Hooks.
Returns
bool.
Usage
$result = Features::enable( $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::enable() Features::enable code WC 11.3.0
public static function enable( $feature ) {
wc_deprecated_function( __METHOD__, '11.1.0', 'FeaturesUtil::feature_is_enabled()' );
if ( 'analytics' === $feature ) {
update_option( Analytics::TOGGLE_OPTION_NAME, 'yes' );
return true;
}
if ( 'remote-inbox-notifications' === $feature ) {
update_option( RemoteInboxNotifications::TOGGLE_OPTION_NAME, 'yes' );
return true;
}
return false;
}