add_filter( 'wcml_gui_additional_box_data', 'the_callback_function', 10, 4 );
- ประเภท
- filter
- หมวดหมู่
- เบ็ดเตล็ด
- เวอร์ชันของ WooCommerce Multilingual
- 3.8.1
คำอธิบาย
- เพิ่มข้อมูลการแปลสำหรับฟิลด์ในส่วนที่กำหนดเองของตัวแก้ไขการแปล WCML
- หากต้องการเพิ่มฟิลด์ โปรดดูที่ฮุก wcml_gui_additional_box_html
อาร์กิวเมนต์
มีพารามิเตอร์ 4 ตัวที่ถูกส่งไปยังฟิลเตอร์นี้:- $data
- (array) อาร์เรย์ข้อมูลงานแปล
- $product_id
- (integer) ID ของสินค้าต้นฉบับ
- $translation
- (object) ออบเจ็กต์งานแปล
- $target_language
- (string) รหัสภาษาของสินค้าที่แปล
ตัวอย่างการใช้งาน
ตัวอย่าง
add_filter( 'wcml_gui_additional_box_data', 'my_custom_action', 10, 4 );
function my_custom_action( $data, $product_id, $translation, $target_language ) {
// my custom action
}
ฮุกที่เกี่ยวข้อง
wcml_new_order_admin_email_language, translate_shipping_methods_in_package, wcml_gui_additional_box_html, wcml_current_gateway_language, wcml_variation_term_taxonomy_ids, wcml_is_attributes_page, wcml_is_variable_product, wcml_after_load_lock_fields_js, wcml_wc_installed_pages, wcml_not_display_single_fields_to_translate