WordPress at Your Fingertips
function is not described

WC_Tax::_update_tax_rate() public WC 2.3.0

Update a tax rate.

Internal use only.

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

Hooks from the method

Return

null. Nothing.

Usage

$result = WC_Tax::_update_tax_rate( $tax_rate_id, $tax_rate );
$tax_rate_id(int) (required)
Tax rate to update.
$tax_rate(array) (required)
Tax rate values.

Changelog

Since 2.3.0 Introduced.

Code of WC_Tax::_update_tax_rate() WC 5.9.0

public static function _update_tax_rate( $tax_rate_id, $tax_rate ) {
	global $wpdb;

	$tax_rate_id = absint( $tax_rate_id );

	$wpdb->update(
		$wpdb->prefix . 'woocommerce_tax_rates',
		self::prepare_tax_rate( $tax_rate ),
		array(
			'tax_rate_id' => $tax_rate_id,
		)
	);

	WC_Cache_Helper::invalidate_cache_group( 'taxes' );

	do_action( 'woocommerce_tax_rate_updated', $tax_rate_id, $tax_rate );
}