wc_update_240_webhooks

The WooCommerce wc update 240 webhooks function.

Description

wc_update_240_webhooks(); 

Usage

  1. if ( !function_exists( 'wc_update_240_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_240_webhooks(); 
  7.  

Defined (1)

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

/includes/wc-update-functions.php  
  1. function wc_update_240_webhooks() { 
  2. global $wpdb; 
  3. /** 
  4. * Webhooks. 
  5. * Make sure order.update webhooks get the woocommerce_order_edit_status hook. 
  6. */ 
  7. $order_update_webhooks = get_posts( array( 
  8. 'posts_per_page' => -1,  
  9. 'post_type' => 'shop_webhook',  
  10. 'meta_key' => '_topic',  
  11. 'meta_value' => 'order.updated',  
  12. ) ); 
  13. foreach ( $order_update_webhooks as $order_update_webhook ) { 
  14. $webhook = new WC_Webhook( $order_update_webhook->ID ); 
  15. $webhook->set_topic( 'order.updated' );