WordPress at Your Fingertips
function is not described

WC_Shipping_Zone_Data_Store::update() public WC 3.0.0

Update zone in the database.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Shipping_Zone_Data_Store = new WC_Shipping_Zone_Data_Store();
$WC_Shipping_Zone_Data_Store->update( $zone );
$zone(WC_Shipping_Zone) (required) (passed by reference — &)
Shipping zone object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Shipping_Zone_Data_Store::update() WC 5.8.0

public function update( &$zone ) {
	global $wpdb;
	if ( $zone->get_id() ) {
		$wpdb->update(
			$wpdb->prefix . 'woocommerce_shipping_zones',
			array(
				'zone_name'  => $zone->get_zone_name(),
				'zone_order' => $zone->get_zone_order(),
			),
			array( 'zone_id' => $zone->get_id() )
		);
	}
	$zone->save_meta_data();
	$this->save_locations( $zone );
	$zone->apply_changes();
	WC_Cache_Helper::invalidate_cache_group( 'shipping_zones' );
	WC_Cache_Helper::get_transient_version( 'shipping', true );
}