WPML

문제 개요

현재 Elementor의 Social Icons 위젯을 사용할 때 해당 링크와 속성을 번역할 수 없습니다.

임시 해결 방법

이 문제는 WPML Multilingual CMS 4.8에서 해결되었습니다. 업데이트하면 사이트에서 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.

진행하기 전에 반드시 사이트의 전체 백업을 완료하세요.

  • 테마의 functions.php 파일에 아래의 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 페이지를 업데이트하고 다시 번역하세요.

모든 알려진 문제

여전히 이 문제가 발생합니까?

업데이트해도 문제가 해결되지 않으면 지원 문의를 하세요. 함께 살펴보겠습니다.