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

Beschreibung

Fügen Sie benutzerdefinierte Felder im WCML-Übersetzungs-Editor hinzu oder entfernen Sie diese.

Argumente

An diesen Filter werden zwei Parameter übergeben:
$fields
(array) Das Array der benutzerdefinierten Felder.
$product_id
(integer) Die ID eines Originalprodukts.

Anwendungsbeispiel

Beispiel
/*
 * 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

Alle 3 Einfügen von Inhalten-Hooks →