WC_Tracker::get_order_counts()private staticWC 1.0

Get order counts.

Method of the class: WC_Tracker{}

No Hooks.

Return

Array.

Usage

$result = WC_Tracker::get_order_counts();

WC_Tracker::get_order_counts() code WC 7.5.1

private static function get_order_counts() {
	$order_count      = array();
	$order_count_data = wp_count_posts( 'shop_order' );
	foreach ( wc_get_order_statuses() as $status_slug => $status_name ) {
		$order_count[ $status_slug ] = $order_count_data->{ $status_slug };
	}
	return $order_count;
}