EDD_Customer_Query::__construct( string|array $query = '', $edd_db_customers = null )
Constructor.
Description Description
Sets up the customer query defaults and optionally runs a query.
Parameters Parameters
- $query
-
(Optional) Array or query string of customer query parameters.
- 'number'
(int) Maximum number of customers to retrieve. Default 20. - 'offset'
(int) Number of customers to offset the query. Default 0. - 'orderby'
(string|array) Customer status or array of statuses. To use 'meta_value' or 'meta_value_num',$meta_key
must also be provided. To sort by a specific$meta_query
clause, use that clause's array key. Accepts 'id', 'user_id', 'name', 'email', 'payment_ids', 'purchase_value', 'purchase_count', 'notes', 'date_created', 'meta_value', 'meta_value_num', the value of$meta_key
, and the array keys of$meta_query
. Also accepts false, an empty array, or 'none' to disable theORDER BY
clause. Default 'id'. - 'order'
(string) How to order retrieved customers. Accepts 'ASC', 'DESC'. Default 'DESC'. - 'include'
(string|array) String or array of customer IDs to include. - 'exclude'
(string|array) String or array of customer IDs to exclude. - 'users_include'
(string|array) String or array of customer user IDs to include. - 'users_exclude'
(string|array) String or array of customer user IDs to exclude. - 'email'
(string|array) Limit results to those customers affiliated with one of the given emails. - 'search'
(string) Search term(s) to retrieve matching customers for. Searches through customer names. - 'search_columns'
(string|array) Columns to search using the value of$search
. Default 'name'. - 'meta_key'
(string) Include customers with a matching customer meta key. - 'meta_value'
(string) Include customers with a matching customer meta value. Requires$meta_key
to be set. - 'meta_query'
(array) Meta query clauses to limit retrieved customers by. SeeWP_Meta_Query
. - 'date_query'
(array) Date query clauses to limit retrieved customers by. SeeWP_Date_Query
. - 'count'
(bool) Whether to return a count (true) instead of an array of customer objects. Default false. - 'no_found_rows'
(bool) Whether to disable theSQL_CALC_FOUND_ROWS
query. Default true.
Default value: ''
- 'number'
Source Source
File: includes/class-edd-customer-query.php
Changelog Changelog
Version | Description |
---|---|
2.8 | Introduced. |