Automattic\WooCommerce\Internal\ShopperLists
ShopperList::get_by_slug
Load a list by slug. Returns false for a disabled, unknown, or unloadable list.
Method of the class: ShopperList{}
No Hooks.
Returns
self|false.
Usage
$result = ShopperList::get_by_slug( $slug, ?int $user_id );
- $slug(string) (required)
- List identifier.
- ?int $user_id
- .
Default:null
ShopperList::get_by_slug() ShopperList::get by slug code 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 );
}