WPML
add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );
Type
filter
Version de WooCommerce Multilingual
3.6

Description

Ajoutez ou supprimez des champs personnalisés dans l’Éditeur de traduction de WCML.

Arguments

Deux paramètres sont passés à ce filtre :
$fields
(tableau) Le tableau des champs personnalisés.
$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_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;
}

wcml_after_duplicate_product, wcml_product_content_label

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