WPML
add_action( 'wcml_after_duplicate_product', 'the_callback_function', 10, 2 );
Loại
action
Danh mục
Chèn nội dung
Phiên bản WooCommerce Multilingual
3.5

Miêu tả

Chạy các hành động sau khi nhân bản một sản phẩm.

Đối số

Có hai tham số được truyền cho hành động này:
$new_id
(số nguyên) ID của sản phẩm mới.
$post_to_duplicate
(đối tượng) Dữ liệu bài viết gốc để nhân bản.

Ví dụ sử dụng

Ví dụ
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

Tất cả 3 hook Chèn nội dung →