WPML
add_filter( 'wcml_product_content_label', 'the_callback_function', 10, 2 );
Version de WooCommerce Multilingual
3.6

Description

Modifiez les noms des champs personnalisés dans l’Éditeur de traduction de WCML.

Arguments

Deux paramètres sont passés à ce filtre :
$meta_key
(chaîne) La clé du champ personnalisé.
$product_id
(entier) L’ID d’un produit original.

Exemple d’utilisation

Exemple
/*
 * 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;
}

wcml_after_duplicate_product, wcml_product_content_fields

Les 3 hooks de la catégorie Insertion de contenu →