Merge pull request #12775 from kahanit/patch-1

Actions on delete of zone and zone method
This commit is contained in:
Mike Jolley 2017-01-11 11:06:42 +00:00 committed by GitHub
commit 4e12ca6332
1 changed files with 3 additions and 0 deletions

View File

@ -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 );
}
/**