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.
Метод класса: ShopperListsController{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ShopperListsController = new ShopperListsController(); $ShopperListsController->is_enabled( ?string $list_slug ): bool;
- ?string $list_slug
- .
По умолчанию:null
Код ShopperListsController::is_enabled() ShopperListsController::is enabled WC 11.2.2
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 );
}