Automattic\WooCommerce\Internal\ShopperLists
ShopperList::get_all_for_user
Get all of the user's lists.
Method of the class: ShopperList{}
No Hooks.
Returns
Array
Usage
$result = ShopperList::get_all_for_user( ?int $user_id ): array;
- ?int $user_id
- .
Default:null
ShopperList::get_all_for_user() ShopperList::get all for user code WC 10.9.1
public static function get_all_for_user( ?int $user_id = null ): array {
$result = array();
foreach ( wc_get_container()->get( ShopperListsController::class )->get_enabled_slugs() as $slug ) {
$list = self::get_by_slug( $slug, $user_id );
if ( $list ) {
$result[ $slug ] = $list;
}
}
return $result;
}