add_filter( 'wcml_product_content_label', 'the_callback_function', 10, 2 );
- Category
- Inserting Content
- WooCommerce Multilingual Version
- 3.6
Description
Modify custom field names in the WCML Translation Editor.
Arguments
There are two parameters passed to this filter:- $meta_key
- (string) The custom field key.
- $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_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;
}