Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes

CustomerHistory::get_excluded_statusesprivateWC 1.0

Get the list of excluded order statuses for customer history.

Method of the class: CustomerHistory{}

Returns

String[]. Excluded status slugs without wc- prefix (e.g. 'auto-draft', 'trash', 'pending', 'failed', 'cancelled').

Usage

// private - for code of main (parent) class only
$result = $this->get_excluded_statuses(): array;

CustomerHistory::get_excluded_statuses() code WC 10.8.1

private function get_excluded_statuses(): array {
	if ( null !== $this->excluded_statuses ) {
		return $this->excluded_statuses;
	}

	$excluded_statuses = get_option( 'woocommerce_excluded_report_order_statuses', array( 'pending', 'failed', 'cancelled' ) );
	if ( ! is_array( $excluded_statuses ) ) {
		$excluded_statuses = array( 'pending', 'failed', 'cancelled' );
	}
	$excluded_statuses = array_merge( array( 'auto-draft', 'trash' ), $excluded_statuses );

	/**
	 * Filter the list of excluded order statuses for customer history and analytics reports.
	 *
	 * @since 4.0.0
	 * @param array $excluded_statuses Order statuses to exclude.
	 */
	$excluded_statuses = apply_filters( 'woocommerce_analytics_excluded_order_statuses', $excluded_statuses );
	if ( ! is_array( $excluded_statuses ) ) {
		$excluded_statuses = array( 'auto-draft', 'trash', 'pending', 'failed', 'cancelled' );
	}

	$this->excluded_statuses = $excluded_statuses;
	return $this->excluded_statuses;
}