Automattic\WooCommerce\Admin\API\Reports\Orders

DataStore::get_all_statusespublic staticWC 1.0

Get all statuses that have been synced.

Method of the class: DataStore{}

No Hooks.

Returns

String[]. Unique order statuses.

Usage

$result = DataStore::get_all_statuses();

DataStore::get_all_statuses() code WC 10.9.4

public static function get_all_statuses() {
	global $wpdb;

	$statuses = wp_cache_get( self::ORDERS_STATUSES_ALL_CACHE_KEY, 'woocommerce_analytics' );
	if ( false === $statuses ) {
		$table_name = self::get_db_table_name();
		$statuses   = $wpdb->get_col( $wpdb->prepare( 'SELECT DISTINCT status FROM %i', $table_name ) );
		wp_cache_set( self::ORDERS_STATUSES_ALL_CACHE_KEY, $statuses, 'woocommerce_analytics', YEAR_IN_SECONDS );
	}

	return $statuses;
}