Automattic\WooCommerce\Internal\Admin
Loader::get_unregistered_order_statuses
Deprecated since migrate to \Automattic\WooCommerce\Internal\Admin\Settings instead.. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Get all order statuses present in analytics tables that aren't registered.
Method of the class: Loader{}
No Hooks.
Returns
Array. Unregistered order statuses.
Usage
$result = Loader::get_unregistered_order_statuses();
Changelog
| Deprecated | migrate to \Automattic\WooCommerce\Internal\Admin\Settings instead. |
Loader::get_unregistered_order_statuses() Loader::get unregistered order statuses code WC 10.6.2
public static function get_unregistered_order_statuses() {
wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.9.0' );
$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 = Settings::get_order_statuses( array_fill_keys( $unregistered_statuses, '' ) );
$formatted_statuses = array_keys( $formatted_status_keys );
return array_combine( $formatted_statuses, $formatted_statuses );
}