Automattic\WooCommerce\Internal\Admin
Settings::get_order_statuses
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() Settings::get order statuses WC 10.4.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;
}