woocommerce_rest_delete_(post_type) action-hookWC 1.0

Fires after a single item is deleted or trashed via the REST API.

Usage

add_action( 'woocommerce_rest_delete_(post_type)', 'wp_kama_woocommerce_rest_delete_post_type_action', 10, 3 );

/**
 * Function for `woocommerce_rest_delete_(post_type)` action-hook.
 * 
 * @param object           $post     The deleted or trashed item.
 * @param WP_REST_Response $response The response data.
 * @param WP_REST_Request  $request  The request sent to the API.
 *
 * @return void
 */
function wp_kama_woocommerce_rest_delete_post_type_action( $post, $response, $request ){

	// action...
}
$post(object)
The deleted or trashed item.
$response(WP_REST_Response)
The response data.
$request(WP_REST_Request)
The request sent to the API.

Where the hook is called

WC_REST_Products_V1_Controller::delete_item()
woocommerce_rest_delete_(post_type)
WC_REST_Posts_Controller::delete_item()
woocommerce_rest_delete_(post_type)
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-products-v1-controller.php 1722
do_action( "woocommerce_rest_delete_{$this->post_type}", $post, $response, $request );
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-posts-controller.php 477
do_action( "woocommerce_rest_delete_{$this->post_type}", $post, $response, $request );

Where the hook is used in WooCommerce

Usage not found.