WC_API_Customers::get_customer_orders()
Get the orders for a customer
Метод класса: WC_API_Customers{}
Хуков нет.
Возвращает
Массив|WP_Error
.
Использование
$WC_API_Customers = new WC_API_Customers(); $WC_API_Customers->get_customer_orders( $id, $fields, $filter );
- $id(int) (обязательный)
- the customer ID
- $fields(строка)
- fields to include in response
По умолчанию: null - $filter(массив)
- filters
По умолчанию: array()
Список изменений
С версии 2.1 | Введена. |
Код WC_API_Customers::get_customer_orders() WC API Customers::get customer orders WC 8.7.0
public function get_customer_orders( $id, $fields = null, $filter = array() ) { $id = $this->validate_request( $id, 'customer', 'read' ); if ( is_wp_error( $id ) ) { return $id; } $filter['customer_id'] = $id; $orders = WC()->api->WC_API_Orders->get_orders( $fields, $filter, null, -1 ); return $orders; }