WordPress at Your Fingertips
function is not described

WC_Shipping_Zone::set_locations() public WC 1.0

Set locations.

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

No Hooks.

Return

null. Nothing.

Usage

$WC_Shipping_Zone = new WC_Shipping_Zone();
$WC_Shipping_Zone->set_locations( $locations );
$locations(array)
Array of locations.
Default: array()

Code of WC_Shipping_Zone::set_locations() WC 5.6.0

public function set_locations( $locations = array() ) {
	$this->clear_locations();
	foreach ( $locations as $location ) {
		$this->add_location( $location['code'], $location['type'] );
	}
}