WC_Webhook::process
Process the webhook for delivery by verifying that it should be delivered. and scheduling the delivery (in the background by default, or immediately).
Method of the class: WC_Webhook{}
Hooks from the method
Returns
Mixed. $arg Returns the argument in case the webhook was hooked into a filter.
Usage
$WC_Webhook = new WC_Webhook(); $WC_Webhook->process( $arg );
- $arg(mixed) (required)
- The first argument provided from the associated hooks.
Changelog
| Since 2.2.0 | Introduced. |
WC_Webhook::process() WC Webhook::process code WC 10.5.0
public function process( $arg ) {
// Verify that webhook should be processed for delivery.
if ( ! $this->should_deliver( $arg ) ) {
return;
}
// Mark this $arg as processed to ensure it doesn't get processed again within the current request.
$this->processed[] = $arg;
/**
* Process webhook delivery.
*
* @since 3.3.0
* @hooked wc_webhook_process_delivery - 10
*/
do_action( 'woocommerce_webhook_process_delivery', $this, $arg );
return $arg;
}