- สถานะ
- แก้ไขแล้ว
- รายงานสำหรับ
- WPML Multilingual CMS 4.6.5
- แก้ไขใน
- WPML Multilingual CMS 4.8
- ปลั๊กอิน/ธีมที่เกี่ยวข้อง
- Elementor
- แท็กหัวข้อ
- Compatibility
ภาพรวมของปัญหา
ขณะนี้ เมื่อคุณใช้งานวิดเจ็ต Social Icons ของ Elementor จะไม่สามารถแปลลิงก์และแอตทริบิวต์ได้
วิธีแก้ปัญหาชั่วคราว
โปรดตรวจสอบให้แน่ใจว่าคุณได้สำรองข้อมูลทั้งหมดของไซต์ของคุณก่อนดำเนินการต่อ
- เพิ่มโค้ด PHP ด้านล่างลงในไฟล์ functions.php ของธีมของคุณ:
add_action('init', function () { add_filter('wpml_elementor_widgets_to_translate', function ($widgets) { $widgets['social-icons'] = [ 'conditions' => ['widgetType' => 'social-icons'], 'fields' => [], 'integration-class' => 'elementorSocialIcons' ]; return $widgets; }); /** * Class to translate the Elementor social-icons widget. * * @see wpmltriage-481 */ class elementorSocialIcons extends WPML_Elementor_Module_With_Items { /** * @return string */ public function get_items_field() { return 'social_icon_list'; } /** * @return array */ public function get_fields() { return [ 'link' => [ 'url', 'custom_attributes' ] ]; } /** * @param string $field * * @return string */ protected function get_title($field) { switch ($field) { case 'url': return esc_html__('Social Icon: URL', 'elementor'); case 'custom_attributes': return esc_html__('Social Icon: Custom Attributes', 'elementor'); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type($field) { switch ($field) { case 'custom_attributes': return 'LINE'; case 'url': return 'LINK'; default: return ''; } } } }); - อัปเดตหน้า Elementor ของคุณและแปลอีกครั้ง