WC_Tax::_delete_tax_rate()public staticWC 2.3.0

Delete a tax rate from the database.

Internal use only.

Method of the class: WC_Tax{}

Hooks from the method

Return

null. Nothing (null).

Usage

$result = WC_Tax::_delete_tax_rate( $tax_rate_id );
$tax_rate_id(int) (required)
Tax rate to delete.

Changelog

Since 2.3.0 Introduced.

WC_Tax::_delete_tax_rate() code WC 9.4.2

public static function _delete_tax_rate( $tax_rate_id ) {
	global $wpdb;

	$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rate_locations WHERE tax_rate_id = %d;", $tax_rate_id ) );
	$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %d;", $tax_rate_id ) );

	WC_Cache_Helper::invalidate_cache_group( 'taxes' );

	do_action( 'woocommerce_tax_rate_deleted', $tax_rate_id );
}