rest_delete_product_review

Fires after a product review is deleted via the REST API.

Description

do_action( 'rest_delete_product_review', (object) $product_review, (WP_REST_Response) $response, (WP_REST_Request) $request ); 

Parameters (3)

0. $product_review (object)
The product review.
1. $response (WP_REST_Response)
The response data.
2. $request (WP_REST_Request)
The request sent to the API.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'rest_delete_product_review', $product_review, $response, $request ); 
The following example is for adding a hook callback.
  1. // define the rest_delete_product_review callback 
  2. function action_rest_delete_product_review( $product_review, $response, $request ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'rest_delete_product_review', 'action_rest_delete_product_review', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'rest_delete_product_review', 'action_rest_delete_product_review', 10, 3 ); 

Defined (2)

The action is defined in the following location(s).

/includes/api/v1/class-wc-rest-product-reviews-controller.php  
  1. do_action( 'rest_delete_product_review', $product_review, $response, $request ); 
/includes/api/class-wc-rest-shipping-zone-methods-controller.php  
  1. do_action( 'rest_delete_product_review', $method, $response, $request );