WC_Tax::sort_rates()
Logical sort order for tax rates based on the following in order of priority.
Метод класса: WC_Tax{}
Хуков нет.
Возвращает
Массив
.
Использование
$result = WC_Tax::sort_rates( $rates );
- $rates(массив) (обязательный)
- Rates to be sorted.
Код WC_Tax::sort_rates() WC Tax::sort rates WC 9.4.2
private static function sort_rates( $rates ) { uasort( $rates, __CLASS__ . '::sort_rates_callback' ); $i = 0; foreach ( $rates as $key => $rate ) { $rates[ $key ]->tax_rate_order = $i++; } return $rates; }