Merge pull request #15452 from woocommerce/fix/15440

Add correct args to woocommerce_shipping_zone_method_deleted
This commit is contained in:
Claudiu Lodromanean 2017-06-05 11:00:22 -07:00 committed by GitHub
commit 2e6219f682
1 changed files with 7 additions and 2 deletions

View File

@ -420,8 +420,13 @@ class WC_Shipping_Zone extends WC_Legacy_Shipping_Zone {
return false; return false;
} }
$this->data_store->delete_method( $instance_id ); // Get method details.
do_action( 'woocommerce_shipping_zone_method_deleted', $instance_id, $this->get_id() ); $method = $this->data_store->get_method( $instance_id );
if ( $method ) {
$this->data_store->delete_method( $instance_id );
do_action( 'woocommerce_shipping_zone_method_deleted', $instance_id, $method->method_id, $this->get_id() );
}
WC_Cache_Helper::get_transient_version( 'shipping', true ); WC_Cache_Helper::get_transient_version( 'shipping', true );