add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );
- Type
- filter
- Category
- Inserting Content
- WooCommerce Multilingual Version
- 3.6
Description
Add or remove custom fields in the WCML Translation Editor.
Arguments
There are two parameters passed to this filter:- $fields
- (array) The custom field array.
- $product_id
- (integer) The ID of an original product.
Example usage
Example
/*
* 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;
}