Skip Navigation
availability:

WooCommerce Multilingual Version: 3.6

description:

Add or remove custom fields in the WCML Translation Editor.

type:
filter
category:
Inserting Content
parameters:
add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );

There are two parameters passed to this filter:

$fields
(array) The custom field array.
$product_id
(integer) The ID of an original product.
hook 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;
}