WordPress at Your Fingertips
function is not described

WC_Shipping_Zone_Data_Store::read_zone_locations() private WC 1.0

Read location data from the database.

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

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->read_zone_locations( $zone );
$zone(WC_Shipping_Zone) (required) (passed by reference — &)
Shipping zone object.

Code of WC_Shipping_Zone_Data_Store::read_zone_locations() WC 5.6.0

private function read_zone_locations( &$zone ) {
	global $wpdb;

	$locations = $wpdb->get_results(
		$wpdb->prepare(
			"SELECT location_code, location_type FROM {$wpdb->prefix}woocommerce_shipping_zone_locations WHERE zone_id = %d",
			$zone->get_id()
		)
	);

	if ( $locations ) {
		foreach ( $locations as $location ) {
			$zone->add_location( $location->location_code, $location->location_type );
		}
	}
}