You appear to be a bot. Output may be restricted
Description
Constructor.
Sets up the customer query defaults and optionally runs a query.
Usage
EDD_Customer_Query::__construct( $query, $edd_db_customers );
Parameters
- $query
- ( string|array ) optional – { Optional. Array or query string of customer query parameters. Default empty.
- $number
- ( int ) optional – Maximum number of customers to retrieve. Default 20.
- $offset
- ( int ) optional – Number of customers to offset the query. Default 0.
- $orderby
- ( string|array ) optional – 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 ) optional – How to order retrieved customers. Accepts 'ASC', 'DESC'. Default 'DESC'.
- $include
- ( string|array ) optional – String or array of customer IDs to include. Default empty.
- $exclude
- ( string|array ) optional – String or array of customer IDs to exclude. Default empty.
- $users_include
- ( string|array ) optional – String or array of customer user IDs to include. Default empty.
- $users_exclude
- ( string|array ) optional – String or array of customer user IDs to exclude. Default empty.
- ( string|array ) optional – Limit results to those customers affiliated with one of the given emails. Default empty.
- $search
- ( string ) optional – Search term(s) to retrieve matching customers for. Searches through customer names. Default empty.
- $search_columns
- ( string|array ) optional – Columns to search using the value of `$search`. Default 'name'.
- $meta_key
- ( string ) optional – Include customers with a matching customer meta key. Default empty.
- $meta_value
- ( string ) optional – Include customers with a matching customer meta value. Requires
$meta_key
to be set. Default empty. - $meta_query
- ( array ) optional – Meta query clauses to limit retrieved customers by. See `WP_Meta_Query`. Default empty.
- $date_query
- ( array ) optional – Date query clauses to limit retrieved customers by. See `WP_Date_Query`. Default empty.
- $count
- ( bool ) optional – Whether to return a count (true) instead of an array of customer objects. Default false.
- $no_found_rows
- ( bool ) optional – Whether to disable the
SQL_CALC_FOUND_ROWS
query. Default true. } - $edd_db_customers
- ( mixed ) optional –
Returns
void
Source
File name: easy-digital-downloads/includes/class-edd-customer-query.php
Lines:
1 to 36 of 36
public function __construct( $query = '', $edd_db_customers = null ) { if ( $edd_db_customers ) { $this->edd_db_customers = $edd_db_customers; } else { $this->edd_db_customers = EDD()->customers; } $this->table_name = $this->edd_db_customers->table_name; $this->meta_type = $this->edd_db_customers->meta_type; $this->primary_key = $this->edd_db_customers->primary_key; $this->date_key = $this->edd_db_customers->date_key; $this->cache_group = $this->edd_db_customers->cache_group; $this->query_var_defaults = array( 'number' => 20, 'offset' => 0, 'orderby' => 'id', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'users_include' => '', 'users_exclude' => '', 'email' => '', 'search' => '', 'meta_key' => '', 'meta_value' => '', 'meta_query' => '', 'date_query' => null, 'count' => false, 'no_found_rows' => true, ); if ( ! empty( $query ) ) { $this->query( $query ); } }