Automattic\WooCommerce\Internal\ShopperLists

ShopperList::get_all_for_userpublic staticWC 1.0

Get all of the user's lists.

Метод класса: ShopperList{}

Хуков нет.

Возвращает

Массив<Строку,. self>

Использование

$result = ShopperList::get_all_for_user( ?int $user_id ): array;
?int $user_id
.
По умолчанию: null

Код ShopperList::get_all_for_user() 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;
}