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.
Метод класса: AssetDataRegistry{}
Хуков нет.
Возвращает
Массив. formatted statuses.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_order_statuses();
Код AssetDataRegistry::get_order_statuses() AssetDataRegistry::get order statuses WC 10.5.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;
}