Merge pull request #12775 from kahanit/patch-1
Actions on delete of zone and zone method
This commit is contained in:
commit
4e12ca6332
|
@ -94,7 +94,9 @@ class WC_Shipping_Zone_Data_Store extends WC_Data_Store_WP implements WC_Shippin
|
|||
$wpdb->delete( $wpdb->prefix . 'woocommerce_shipping_zone_locations', array( 'zone_id' => $zone->get_id() ) );
|
||||
$wpdb->delete( $wpdb->prefix . 'woocommerce_shipping_zones', array( 'zone_id' => $zone->get_id() ) );
|
||||
WC_Cache_Helper::incr_cache_prefix( 'shipping_zones' );
|
||||
$id = $zone->get_id();
|
||||
$zone->set_id( null );
|
||||
do_action( 'woocommerce_delete_shipping_zone', $id );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,6 +162,7 @@ class WC_Shipping_Zone_Data_Store extends WC_Data_Store_WP implements WC_Shippin
|
|||
public function delete_method( $instance_id ) {
|
||||
global $wpdb;
|
||||
$wpdb->delete( $wpdb->prefix . 'woocommerce_shipping_zone_methods', array( 'instance_id' => $instance_id ) );
|
||||
do_action( 'woocommerce_delete_shipping_zone_method', $instance_id );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue