Automattic\WooCommerce\Internal\Admin

Settings::get_unregistered_order_statuses()privateWC 1.0

Get all order statuses present in analytics tables that aren't registered.

Method of the class: Settings{}

No Hooks.

Return

Array. Unregistered order statuses.

Usage

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

Settings::get_unregistered_order_statuses() code WC 7.1.0

private function get_unregistered_order_statuses() {
	$registered_statuses   = wc_get_order_statuses();
	$all_synced_statuses   = OrdersDataStore::get_all_statuses();
	$unregistered_statuses = array_diff( $all_synced_statuses, array_keys( $registered_statuses ) );
	$formatted_status_keys = self::get_order_statuses( array_fill_keys( $unregistered_statuses, '' ) );
	$formatted_statuses    = array_keys( $formatted_status_keys );

	return array_combine( $formatted_statuses, $formatted_statuses );
}