WPML
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

}

wcml_product_content_fields, wcml_product_content_label

ฮุก การแทรกเนื้อหา ทั้งหมด 3 รายการ →