تابع wc_update_240_webhooks بروزرسانی وب هوک های ووکامرس به نسخه 2.4.0

تابع ووکامرسی wc_update_240_webhooks – بروزرسانی وب هوک های ووکامرس به نسخه 2.4.0
Syntax – سینتکس
wc_update_240_webhooks();
Usage – نحوه استفاده
if ( !function_exists( 'wc_update_240_webhooks' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php';
}
// NOTICE! Understand what this does before running.
$result = wc_update_240_webhooks();
Defined – محل تعریف
/includes/wc-update-functions.php
function wc_update_240_webhooks() {
global $wpdb;
/**
* 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' );
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر