WC_Tax::prepare_tax_rate()private staticWC 1.0

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 8.7.0

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;
}