Automattic\WooCommerce\Internal\Admin

Settings::get_order_statuses()public staticWC 1.0

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

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

Хуков нет.

Возвращает

Массив. formatted statuses.

Использование

$result = Settings::get_order_statuses( $statuses );
$statuses(массив) (обязательный)
Order statuses.

Код Settings::get_order_statuses() WC 8.7.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;
}