WordPress at Your Fingertips
function is not described

WC_API_Customers::get_customers() public WC 2.1

Get all customers

{} It's a method of the class: WC_API_Customers{}

No Hooks.

Return

Array.

Usage

$WC_API_Customers = new WC_API_Customers();
$WC_API_Customers->get_customers( $fields, $filter, $page );
$fields(array)
-
Default: null
$filter(array)
-
Default: array()
$page(int)
-
Default: 1

Changelog

Since 2.1 Introduced.

Code of WC_API_Customers::get_customers() WC 5.7.1

public function get_customers( $fields = null, $filter = array(), $page = 1 ) {

	$filter['page'] = $page;

	$query = $this->query_customers( $filter );

	$customers = array();

	foreach ( $query->get_results() as $user_id ) {

		if ( ! $this->is_readable( $user_id ) ) {
			continue;
		}

		$customers[] = current( $this->get_customer( $user_id, $fields ) );
	}

	$this->server->add_pagination_headers( $query );

	return array( 'customers' => $customers );
}