woocommerce_new_webhook_delivery_data

Create a new comment for log the delivery request/response and.

Description

(int) apply_filters( 'woocommerce_new_webhook_delivery_data', (callback) $var, (unknown) $this_id ); 

return the ID for inclusion in the webhook request.

Returns (int)

delivery (comment) ID

Parameters (2)

0. $var — Optional. (callback) => array( 'comment_author' => __( 'WooCommerce', 'woocommerce' ), 'comment_author_email' => sanitize_email( sprintf( '%s@%s', strtolower( __( 'WooCommerce', 'woocommerce' ) ), isset( $_SERVER['HTTP_HOST'] ) ? str_replace( 'www.', '', $_SERVER['HTTP_HOST'] ) : 'noreply.com' ) ), 'comment_post_ID' => $this->id, 'comment_agent' => 'WooCommerce Hookshot', 'comment_type' => 'webhook_delivery', 'comment_parent' => 0, 'comment_approved' => 1, )
The array.
1. $this_id (unknown)
The this id.

Usage

To run the hook, copy the example below.
  1. $var = apply_filters( 'woocommerce_new_webhook_delivery_data', $var, $this_id ); 
  2.  
  3. if ( !empty( $var ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_new_webhook_delivery_data callback 
  2. function filter_woocommerce_new_webhook_delivery_data( $var, $this_id ) { 
  3. // make filter magic happen here... 
  4. return $var
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_new_webhook_delivery_data', 'filter_woocommerce_new_webhook_delivery_data', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_new_webhook_delivery_data', 'filter_woocommerce_new_webhook_delivery_data', 10, 2 ); 

Defined (1)

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

/includes/class-wc-webhook.php  
  1. $comment_data = apply_filters( 'woocommerce_new_webhook_delivery_data', array(