woocommerce_rest_insert_webhook_object
Fires after a single item is created or updated via the REST API.
Usage
add_action( 'woocommerce_rest_insert_webhook_object', 'wp_kama_woocommerce_rest_insert_webhook_object_action', 10, 3 );
/**
* Function for `woocommerce_rest_insert_webhook_object` action-hook.
*
* @param WC_Webhook $webhook Webhook data.
* @param WP_REST_Request $request Request object.
* @param bool $creating True when creating item, false when updating.
*
* @return void
*/
function wp_kama_woocommerce_rest_insert_webhook_object_action( $webhook, $request, $creating ){
// action...
}
- $webhook(WC_Webhook)
- Webhook data.
- $request(WP_REST_Request)
- Request object.
- $creating(true|false)
- True when creating item, false when updating.
Where the hook is called
woocommerce_rest_insert_webhook_object
woocommerce_rest_insert_webhook_object
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-webhooks-v1-controller.php 370
do_action( 'woocommerce_rest_insert_webhook_object', $webhook, $request, true );
woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-webhooks-v1-controller.php 450
do_action( 'woocommerce_rest_insert_webhook_object', $webhook, $request, false );