Automattic\WooCommerce\Blocks\Assets
AssetDataRegistry::get_order_statuses
Returns block-related data for enqueued wc-settings script. Format order statuses by removing a leading 'wc-' if present.
Method of the class: AssetDataRegistry{}
No Hooks.
Returns
Array. formatted statuses.
Usage
// protected - for code of main (parent) or child class $result = $this->get_order_statuses();
AssetDataRegistry::get_order_statuses() AssetDataRegistry::get order statuses code WC 10.7.0
protected function get_order_statuses() {
$formatted_statuses = array();
foreach ( wc_get_order_statuses() as $key => $value ) {
$formatted_key = preg_replace( '/^wc-/', '', $key );
$formatted_statuses[ $formatted_key ] = $value;
}
return $formatted_statuses;
}