add_action( 'wcml_before_sync_product_data', 'the_callback_function', 10, 3 );
- סוג
- action
- קטגוריה
- עדכון תוכן
- גרסת WooCommerce Multilingual
- 3.7.0
תיאור
- הפעל פעולות לפני ש־WCML מסנכרן נתונים (תמונות, טקסונומיות, וריאציות וכו׳) מהמוצרים המקוריים לתרגומים שלהם.
- פעולה זו נקראת לאחר wcml_before_sync_product.
ארגומנטים
לפעולה זו מועברים שלושה פרמטרים:- $original_product_id
- (מספר שלם) מזהה (ID) של המוצר המקורי.
- $translated_product_id
- (מספר שלם) מזהה (ID) של המוצר המתורגם.
- $target_language
- (מחרוזת) קוד השפה של המוצר המתורגם.
דוגמה לשימוש
דוגמה
add_action( 'wcml_before_sync_product_data', 'my_custom_action', 10, 3 );
function my_custom_action( $original_product_id, $translated_product_id, $target_language ) {
// my custom action
}
הוקים קשורים
wcml_after_duplicate_product_post_meta, wcml_update_extra_fields, wcml_js_lock_fields_ids, wcml_js_lock_fields_input_names, wcml_js_lock_fields_classes, wcml_before_sync_product