Automattic\WooCommerce\StoreApi\Routes\V1
ShopperLists::get_route_response
Return the lists for the current user.
Method of the class: ShopperLists{}
No Hooks.
Returns
\WP_REST_Response.
Usage
// protected - for code of main (parent) or child class $result = $this->get_route_response( $request );
- $request(WP_REST_Request) (required)
- Request object.
ShopperLists::get_route_response() ShopperLists::get route response code WC 10.9.1
protected function get_route_response( \WP_REST_Request $request ) {
$response = array();
foreach ( ShopperList::get_all_for_user() as $list ) {
$response[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $list, $request ) );
}
return rest_ensure_response( $response );
}