WC_Shipping_Zone_Data_Store::add_method( int $zone_id, string $type, int $order )
Add a shipping method to a zone.
Description Description
Parameters Parameters
- $zone_id
-
(Required) Zone ID.
- $type
-
(Required) Method Type/ID.
- $order
-
(Required) Method Order.
Return Return
(int) Instance ID
Source Source
File: includes/data-stores/class-wc-shipping-zone-data-store.php
public function add_method( $zone_id, $type, $order ) { global $wpdb; $wpdb->insert( $wpdb->prefix . 'woocommerce_shipping_zone_methods', array( 'method_id' => $type, 'zone_id' => $zone_id, 'method_order' => $order, ), array( '%s', '%d', '%d', ) ); return $wpdb->insert_id; }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |