WPML
الحالة
في انتظار المطور
الإضافة/القالب ذو الصلة
FacetWP
وسوم الموضوع
Compatibility

نظرة عامة على المشكلة

إذا كنت تستخدم إضافة FacetWP، فقد تواجه مشكلة حيث لا تعرض تسميات حقول مربعات الاختيار، المنشأة باستخدام ACF والمستخدمة في فلاتر FacetWP، ترجماتها عند إدراجها في الصفحات باستخدام أكواد Elementor المختصرة.

حل بديل مؤقت

يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.


  • افتح ملف functions.php الخاص بقالبك.

  • أضف الكود التالي:
    Add the following code to the functions.php file
    // WPML Workaround for compsupp-6751
    function wpml_compsupp6751_translate_facet_display_value( $label, $args ) {
    	if ( class_exists('Sitepress') ) {
    		$wpml_default_lang = apply_filters('wpml_default_language', NULL );
    		$wpml_current_lang = apply_filters( 'wpml_current_language', NULL );
    
    		if ($wpml_default_lang == $wpml_current_lang ) {
    			do_action( 'wpml_register_single_string', 'FacetWP', 'Facet Display Value : '.substr($label, 0, 10), $label );
    		}	
    		// Apply the translation to the string
    		$label = apply_filters('wpml_translate_single_string', $label , 'FacetWP', 'Facet Display Value : '.substr($label, 0, 10) );
    	}
        return $label;
    }
    add_filter( 'facetwp_facet_display_value', 'wpml_compsupp6751_translate_facet_display_value', 10, 2 );
  • زُر الصفحة في الواجهة الأمامية باللغة الأصلية لتسجيل السلاسل النصية
  • انتقل إلى WPML > ترجمة النصوص وترجم السلاسل النصية (FacetWP textdomain / Facet Display Value : * name)

جميع المشاكل المعروفة →