WC_Order_Data_Store_CPT::get_order_count( string $status )

Return count of orders with a specific status.


Description Description


Parameters Parameters

$status

(Required) Order status. Function wc_get_order_statuses() returns a list of valid statuses.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/data-stores/class-wc-order-data-store-cpt.php

	public function get_order_count( $status ) {
		global $wpdb;
		return absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( * ) FROM {$wpdb->posts} WHERE post_type = 'shop_order' AND post_status = %s", $status ) ) );
	}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.