WC_Tax::prepare_tax_rate()private staticWC 1.0

Prepare and format tax rate for DB insertion.

{} It's a method of the class: WC_Tax{}

No Hooks.

Return

Array.

Usage

$result = WC_Tax::prepare_tax_rate( $tax_rate );
$tax_rate(array) (required)
Tax rate to format.

Code of WC_Tax::prepare_tax_rate() WC 6.9.4

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