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