WC_REST_Customers_V2_Controller::get_formatted_item_data()protectedWC 3.0.0

Get formatted item data.

Method of the class: WC_REST_Customers_V2_Controller{}

No Hooks.

Return

Array.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_formatted_item_data( $object );
$object(WC_Data) (required)
WC_Data instance.

Changelog

Since 3.0.0 Introduced.

WC_REST_Customers_V2_Controller::get_formatted_item_data() code WC 8.9.0

protected function get_formatted_item_data( $object ) {
	$formatted_data                 = $this->get_formatted_item_data_core( $object );
	$formatted_data['orders_count'] = $object->get_order_count();
	$formatted_data['total_spent']  = $object->get_total_spent();
	return $formatted_data;
}