WordPress at Your Fingertips
function is not described

WC_Shipping_Zone_Data_Store::get_zone_id_by_instance_id() public WC 3.0.0

Return a zone ID from an instance ID.

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

No Hooks.

Return

Int.

Usage

$WC_Shipping_Zone_Data_Store = new WC_Shipping_Zone_Data_Store();
$WC_Shipping_Zone_Data_Store->get_zone_id_by_instance_id( $id );
$id(int) (required)
Instnace ID.

Changelog

Since 3.0.0 Introduced.

Code of WC_Shipping_Zone_Data_Store::get_zone_id_by_instance_id() WC 5.8.0

public function get_zone_id_by_instance_id( $id ) {
	global $wpdb;
	return $wpdb->get_var( $wpdb->prepare( "SELECT zone_id FROM {$wpdb->prefix}woocommerce_shipping_zone_methods as methods WHERE methods.instance_id = %d LIMIT 1;", $id ) );
}