add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );
- Loại
- filter
- Danh mục
- Chèn nội dung
- Phiên bản WooCommerce Multilingual
- 3.6
Miêu tả
Thêm hoặc xóa trường tùy chỉnh trong Trình biên tập dịch thuật WCML.
Đối số
Có hai tham số được truyền cho bộ lọc này:- $fields
- (mảng) Mảng trường tùy chỉnh.
- $product_id
- (số nguyên) ID của sản phẩm gốc.
Ví dụ sử dụng
Ví dụ
/*
* Add this code to the functions.php file of your theme.
*/
add_filter( 'wcml_product_content_fields', 'add_custom_fields_wcml_editor', 10, 2 );
function add_custom_fields_wcml_editor ( $fields, $product_id ) {
// Add the 'new_button_label' field to WCML Translation Editor
$fields[] = 'new_button_label';
return $fields;
}