wc_update_300_webhooks

The WooCommerce wc update 300 webhooks function.

Description

wc_update_300_webhooks(); 

Usage

  1. if ( !function_exists( 'wc_update_300_webhooks' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_update_300_webhooks(); 
  7.  

Defined (1)

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

/includes/wc-update-functions.php  
  1. function wc_update_300_webhooks() { 
  2. /** 
  3. * Make sure product.update webhooks get the woocommerce_product_quick_edit_save 
  4. * and woocommerce_product_bulk_edit_save hooks. 
  5. */ 
  6. $product_update_webhooks = get_posts( array( 
  7. 'posts_per_page' => -1,  
  8. 'post_type' => 'shop_webhook',  
  9. 'meta_key' => '_topic',  
  10. 'meta_value' => 'product.updated',  
  11. ) ); 
  12. foreach ( $product_update_webhooks as $product_update_webhook ) { 
  13. $webhook = new WC_Webhook( $product_update_webhook->ID ); 
  14. $webhook->set_topic( 'product.updated' );