WordPress at Your Fingertips
function is not described

WC_Tax::_update_tax_rate_cities() public WC 2.3.0

Update cities for a tax rate in the DB.

Internal use only.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Tax::_update_tax_rate_cities( $tax_rate_id, $cities );
$tax_rate_id(int) (required)
Tax rate to update.
$cities(string) (required)
Cities to set.

Changelog

Since 2.3.0 Introduced.

Code of WC_Tax::_update_tax_rate_cities() WC 5.9.0

public static function _update_tax_rate_cities( $tax_rate_id, $cities ) {
	if ( ! is_array( $cities ) ) {
		$cities = explode( ';', $cities );
	}
	$cities = array_filter( array_diff( array_map( array( __CLASS__, 'format_tax_rate_city' ), $cities ), array( '*' ) ) );

	self::update_tax_rate_locations( $tax_rate_id, $cities, 'city' );
}