WC_Shipping_Zone_Data_Store::get_zone_id_by_instance_id()
Return a zone ID from an instance ID.
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)
- Instance ID.
Changelog
Since 3.0.0 | Introduced. |
WC_Shipping_Zone_Data_Store::get_zone_id_by_instance_id() WC Shipping Zone Data Store::get zone id by instance id code WC 9.4.2
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 ) ); }