wc_update_240_webhooks() WC 1.0
Update webhooks for 2.4
No Hooks.
Return
null.
Usage
wc_update_240_webhooks();
Code of wc_update_240_webhooks() wc update 240 webhooks WC 5.0.0
function wc_update_240_webhooks() {
// phpcs:disable WordPress.DB.SlowDBQuery
/**
* Webhooks.
* Make sure order.update webhooks get the woocommerce_order_edit_status hook.
*/
$order_update_webhooks = get_posts(
array(
'posts_per_page' => -1,
'post_type' => 'shop_webhook',
'meta_key' => '_topic',
'meta_value' => 'order.updated',
)
);
foreach ( $order_update_webhooks as $order_update_webhook ) {
$webhook = new WC_Webhook( $order_update_webhook->ID );
$webhook->set_topic( 'order.updated' );
}
// phpcs:enable WordPress.DB.SlowDBQuery
}