WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Settings_Tax::save_tax_rates() public WC 1.0

Save tax rates.

Это метод класса: WC_Settings_Tax{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$WC_Settings_Tax = new WC_Settings_Tax();
$WC_Settings_Tax->save_tax_rates();

Код WC Settings Tax::save tax rates: woocommerce/includes/admin/settings/class-wc-settings-tax.php WC 4.5.2

<?php
public function save_tax_rates() {
	global $wpdb;

	$current_class    = sanitize_title( $this->get_current_tax_class() );
	$posted_countries = wc_clean( wp_unslash( $_POST['tax_rate_country'] ) );

	// get the tax rate id of the first submited row.
	$first_tax_rate_id = key( $posted_countries );

	// get the order position of the first tax rate id.
	$tax_rate_order = absint( $wpdb->get_var( $wpdb->prepare( "SELECT tax_rate_order FROM {$wpdb->prefix}woocommerce_tax_rates WHERE tax_rate_id = %s", $first_tax_rate_id ) ) );

	$index = isset( $tax_rate_order ) ? $tax_rate_order : 0;

	// Loop posted fields.
	foreach ( $posted_countries as $key => $value ) {
		$mode     = ( 0 === strpos( $key, 'new-' ) ) ? 'insert' : 'update';
		$tax_rate = $this->get_posted_tax_rate( $key, $index ++, $current_class );

		if ( 'insert' === $mode ) {
			$tax_rate_id = WC_Tax::_insert_tax_rate( $tax_rate );
		} elseif ( 1 === absint( $_POST['remove_tax_rate'][ $key ] ) ) {
			$tax_rate_id = absint( $key );
			WC_Tax::_delete_tax_rate( $tax_rate_id );
			continue;
		} else {
			$tax_rate_id = absint( $key );
			WC_Tax::_update_tax_rate( $tax_rate_id, $tax_rate );
		}

		if ( isset( $_POST['tax_rate_postcode'][ $key ] ) ) {
			WC_Tax::_update_tax_rate_postcodes( $tax_rate_id, wc_clean( wp_unslash( $_POST['tax_rate_postcode'][ $key ] ) ) );
		}
		if ( isset( $_POST['tax_rate_city'][ $key ] ) ) {
			WC_Tax::_update_tax_rate_cities( $tax_rate_id, wc_clean( wp_unslash( $_POST['tax_rate_city'][ $key ] ) ) );
		}
	}
}