add_action( 'wcml_after_duplicate_product_post_meta', 'the_callback_function', 10, 3 );
- ประเภท
- action
- หมวดหมู่
- การอัปเดตเนื้อหา
- เวอร์ชันของ WooCommerce Multilingual
- 3.5
คำอธิบาย
เรียกใช้การดำเนินการหลังจากที่มีการตั้งค่าฟิลด์ meta ของโพสต์สำหรับผลิตภัณฑ์ที่ทำสำเนา
อาร์กิวเมนต์
มี 3 พารามิเตอร์ที่ส่งไปยังการดำเนินการนี้:- $original_product_id
- (integer) ID ของผลิตภัณฑ์ต้นฉบับ
- $translated_product_id
- (integer) ID ของผลิตภัณฑ์ที่แปล
- $data
- (array) ข้อมูลผลิตภัณฑ์ต้นฉบับ
ตัวอย่างการใช้งาน
ตัวอย่าง
add_action( 'wcml_after_duplicate_product_post_meta', 'my_custom_action', 10, 3 );
function my_custom_action( $original_product_id, $duplicated_product_id, $data ) {
// my custom action
}
ฮุกที่เกี่ยวข้อง
wcml_update_extra_fields, 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