Skip Navigation
availability:

WooCommerce Multilingual Version: 3.6

description:

Modify custom field names in the WCML Translation Editor.

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

There are two parameters passed to this filter:

$meta_key
(string) The custom field key.
$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_label', 'change_field_label', 10, 2 );

function change_field_label( $meta_key, $product_id ) {

	// Change the label of 'new_button_label' field in WCML Translation Editor 

	if ( $meta_key == 'new_button_label' ) {
		return __( 'Translate New Button Label', 'textdomain' );
	}

	return $meta_key;
}