add_action( 'wcml_after_duplicate_product', 'the_callback_function', 10, 2 );
- ประเภท
- action
- หมวดหมู่
- การแทรกเนื้อหา
- เวอร์ชันของ WooCommerce Multilingual
- 3.5
คำอธิบาย
เรียกใช้การดำเนินการหลังจากทำสำเนาสินค้า
อาร์กิวเมนต์
มีพารามิเตอร์ 2 ตัวที่ถูกส่งไปยังการดำเนินการนี้:- $new_id
- (integer) ID ของผลิตภัณฑ์ใหม่
- $post_to_duplicate
- (object) ข้อมูลโพสต์ต้นฉบับที่จะทำสำเนา
ตัวอย่างการใช้งาน
ตัวอย่าง
add_action( 'wcml_after_duplicate_product', 'my_custom_action', 10, 2 );
function my_custom_action( $original_product_id, $new_id, $post_to_duplicate ) {
// my custom action
}