wc_deliver_webhook_async

Wrapper function to execute the `woocommerce_deliver_webhook_async` cron.

Description

wc_deliver_webhook_async( (int) $webhook_id, (mixed) $arg ); 

hook, see WC_Webhook::process().

Parameters (2)

0. $webhook_id (int)
Webhook ID to deliver.
1. $arg (mixed)
Hook argument.

Usage

  1. if ( !function_exists( 'wc_deliver_webhook_async' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
  3.  
  4. // webhook ID to deliver. 
  5. $webhook_id = -1; 
  6.  
  7. // hook argument. 
  8. $arg = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_deliver_webhook_async($webhook_id, $arg); 
  12.  

Defined (1)

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

/includes/wc-core-functions.php  
  1. function wc_deliver_webhook_async( $webhook_id, $arg ) { 
  2.  
  3. $webhook = new WC_Webhook( $webhook_id ); 
  4.  
  5. $webhook->deliver( $arg );