WPML

סקירת התקלה

כרגע, כאשר אתה משתמש בווידג’ט Social Icons של Elementor , לא ניתן לתרגם את הקישורים והמאפיינים שלו.

פתרון עוקף

בעיה זו תוקנה ב־WPML Multilingual CMS 4.8. עדכון פותר זאת באתר שלך, לכן אתה זקוק לפתרון העוקף הזה רק אם עדיין אינך יכול לעדכן.

ודא שיש לך גיבוי מלא של האתר לפני שתמשיך.

  • הוסף את קוד ה־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 שלך ותרגם אותו שוב.

כל התקלות הידועות

עדיין נתקל בבעיה זו?

אם העדכון אינו פותר זאת, פתח פנייה לתמיכה ואנו נבדוק זאת יחד איתך.