WC_Tax::_update_tax_rate( int $tax_rate_id, array $tax_rate )

Update a tax rate.


Description Description

Internal use only.


Parameters Parameters

$tax_rate_id

(Required) Tax rate to update.

$tax_rate

(Required) Tax rate values.


Top ↑

Source Source

File: includes/class-wc-tax.php

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.