WC_Tax::prepare_tax_rate()
Prepare and format tax rate for DB insertion.
Метод класса: WC_Tax{}
Хуков нет.
Возвращает
Массив
.
Использование
$result = WC_Tax::prepare_tax_rate( $tax_rate );
- $tax_rate(массив) (обязательный)
- Tax rate to format.
Код WC_Tax::prepare_tax_rate() WC Tax::prepare tax rate WC 9.7.1
private static function prepare_tax_rate( $tax_rate ) { foreach ( $tax_rate as $key => $value ) { if ( method_exists( __CLASS__, 'format_' . $key ) ) { if ( 'tax_rate_state' === $key ) { $tax_rate[ $key ] = call_user_func( array( __CLASS__, 'format_' . $key ), sanitize_key( $value ) ); } else { $tax_rate[ $key ] = call_user_func( array( __CLASS__, 'format_' . $key ), $value ); } } } return $tax_rate; }