Automattic\WooCommerce\Internal\ShopperLists
ShopperList::get_by_slug
Load a list by slug. Returns false for a disabled, unknown, or unloadable list.
Метод класса: ShopperList{}
Хуков нет.
Возвращает
self|false.
Использование
$result = ShopperList::get_by_slug( $slug, ?int $user_id );
- $slug(строка) (обязательный)
- List identifier.
- ?int $user_id
- .
По умолчанию:null
Код ShopperList::get_by_slug() ShopperList::get by slug WC 11.0.1
public static function get_by_slug( string $slug, ?int $user_id = null ) {
if ( ! wc_get_container()->get( ShopperListsController::class )->is_enabled( $slug ) ) {
return false;
}
return self::get_by_slug_raw( $slug, $user_id );
}