Add action `woocommerce_rest_delete_shipping_zone_method` (#47862)

Add action `woocommerce_rest_delete_shipping_zone_method` and remove inappropriate product review action.
This commit is contained in:
Barry Hughes 2024-05-28 12:14:22 -07:00 committed by GitHub
parent 0fdc4ddd7c
commit 8f7a9ced04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Adds new hook `woocommerce_rest_delete_shipping_zone_method` which will fire after a shipping zone method is deleted via the REST API.

View File

@ -231,13 +231,16 @@ class WC_REST_Shipping_Zone_Methods_V2_Controller extends WC_REST_Shipping_Zones
}
/**
* Fires after a product review is deleted via the REST API.
* Fires after a shipping zone is deleted via the REST API.
*
* @param object $method
* @param WP_REST_Response $response The response data.
* @param WP_REST_Request $request The request sent to the API.
* @since 9.1.0
*
* @param WC_Shipping_Method $method The shipping zone method being deleted.
* @param WC_Shipping_Zone $zone The shipping zone the method belonged to.
* @param WP_REST_Response $response The response data.
* @param WP_REST_Request $request The request sent to the API.
*/
do_action( 'rest_delete_product_review', $method, $response, $request );
do_action( 'woocommerce_rest_delete_shipping_zone_method', $method, $zone, $response, $request );
return $response;
}