تابع wc_update_300_webhooks بروزرسانی وب هوک های ووکامرس به نسخه 3.0.0

تابع ووکامرسی wc_update_300_webhooks – بروزرسانی وب هوک های ووکامرس به نسخه 3.0.0
Syntax – سینتکس
wc_update_300_webhooks();
Usage – نحوه استفاده
if ( !function_exists( 'wc_update_300_webhooks' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-update-functions.php';
}
// NOTICE! Understand what this does before running.
$result = wc_update_300_webhooks();
Defined – محل تعریف
/includes/wc-update-functions.php
function wc_update_300_webhooks() {
/**
* Make sure product.update webhooks get the woocommerce_product_quick_edit_save
* and woocommerce_product_bulk_edit_save hooks.
*/
$product_update_webhooks = get_posts( array(
'posts_per_page' => -1,
'post_type' => 'shop_webhook',
'meta_key' => '_topic',
'meta_value' => 'product.updated',
) );
foreach ( $product_update_webhooks as $product_update_webhook ) {
$webhook = new WC_Webhook( $product_update_webhook->ID );
$webhook->set_topic( 'product.updated' );
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر