add_filter( 'wcml_product_content_fields', 'the_callback_function', 10, 2 );
- סוג
- filter
- קטגוריה
- הכנסת תוכן
- גרסת WooCommerce Multilingual
- 3.6
תיאור
הוסף או הסר שדות מותאמים אישית בעורך התרגום של WCML.
ארגומנטים
שני פרמטרים מועברים לפילטר זה:- $fields
- (array) מערך השדות המותאמים אישית.
- $product_id
- (integer) המזהה (ID) של מוצר מקורי.
דוגמה לשימוש
דוגמה
/*
* 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;
}