Automattic\WooCommerce\Internal\ShopperLists
ShopperListsController::is_enabled
Whether a given list type is on, or whether any list type is on when no slug is passed.
Method of the class: ShopperListsController{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ShopperListsController = new ShopperListsController(); $ShopperListsController->is_enabled( ?string $list_slug ): bool;
- ?string $list_slug
- .
Default:null
ShopperListsController::is_enabled() ShopperListsController::is enabled code WC 11.0.1
public function is_enabled( ?string $list_slug = null ): bool {
if ( null === $list_slug ) {
foreach ( self::SUPPORTED_LISTS as $feature ) {
if ( FeaturesUtil::feature_is_enabled( $feature ) ) {
return true;
}
}
return false;
}
$feature = self::SUPPORTED_LISTS[ $list_slug ] ?? null;
return null !== $feature && FeaturesUtil::feature_is_enabled( $feature );
}