add_action( 'wcml_update_extra_fields', 'the_callback_function', 10, 4 );
- ประเภท
- action
- หมวดหมู่
- การอัปเดตเนื้อหา
- เวอร์ชันของ WooCommerce Multilingual
- 3.5
คำอธิบาย
เรียกใช้ฟังก์ชันที่กำหนดเองของคุณทันทีหลังจากที่ฟิลด์สินค้าที่แปลแล้วได้รับการอัปเดต
อาร์กิวเมนต์
มีพารามิเตอร์ 4 ตัวที่ส่งไปยังการดำเนินการนี้:- $original_product_id
- (integer) ID ของสินค้าต้นฉบับ
- $translated_product_id
- (integer) ID ของสินค้าที่แปล
- $translation_data
- (array) ข้อมูลของสินค้าที่แปล
- $target_language
- (string) รหัสภาษาของสินค้าที่แปล
ตัวอย่างการใช้งาน
ตัวอย่าง
add_action( 'wcml_update_extra_fields', 'my_custom_action', 10, 4 );
function my_custom_action( $original_product_id, $translated_product_id, $translation_data, $target_language ) {
// my custom action
}
ฮุกที่เกี่ยวข้อง
wcml_after_duplicate_product_post_meta, wcml_js_lock_fields_ids, wcml_js_lock_fields_input_names, wcml_js_lock_fields_classes, wcml_before_sync_product, wcml_before_sync_product_data