Automattic\WooCommerce\Internal\Admin

Loader::get_order_statuses()public staticWC 1.0

Format order statuses by removing a leading 'wc-' if present.

Метод класса: Loader{}

No Hooks.

Return

Array. formatted statuses.

Usage

$result = Loader::get_order_statuses( $statuses );
$statuses(array) (required)
Order statuses.

Code of Loader::get_order_statuses() WC 7.1.0

public static function get_order_statuses( $statuses ) {
	$formatted_statuses = array();
	foreach ( $statuses as $key => $value ) {
		$formatted_key                        = preg_replace( '/^wc-/', '', $key );
		$formatted_statuses[ $formatted_key ] = $value;
	}
	return $formatted_statuses;
}