- الحالة
- مفتوحة
- الإضافة/القالب ذو الصلة
- Filter Everything PRO
- وسوم الموضوع
- Compatibility
نظرة عامة على المشكلة
قد يواجه مستخدمو إضافة Filter Everything عند استخدامها مع Advanced Custom Fields مشكلات تتمثل في عدم ترجمة قيم حقول ACF المستخدمة في المرشحات في الواجهة الأمامية. تحدث هذه المشكلة على الرغم من ترجمة الحقول في WPML ترجمة النصوص.
حل بديل مؤقت
يُرجى التأكد من أخذ نسخة احتياطية كاملة لموقعك قبل المتابعة.
- أضف الكود التالي إلى ملف functions.php الخاص بالقالب:
// WPML Workaround for compsupp-7581 add_filter('wpc_terms_before_display', 'wpml_compsupp7581_filter_wpc_filter_terms', 10, 4 ); function wpml_compsupp7581_filter_wpc_filter_terms($terms, $filter, $set, $urlManager) { if ( class_exists('Sitepress') ) { foreach ($terms as &$term ) { $label = $term->name; $textdomain = 'WordPress'; $string_name = 'WPC Filter Label: '.substr($label, 0, 40); if ( apply_filters('wpml_default_language', NULL ) == apply_filters( 'wpml_current_language', NULL )) { do_action( 'wpml_register_single_string', $textdomain, $string_name, $label ); } // Apply the translation to the string $term->name = apply_filters('wpml_translate_single_string', $label , $textdomain, $string_name); } } return $terms; } - زُر الصفحة التي تحتوي على المشكلة باللغة الأصلية. سيؤدي هذا الإجراء إلى تسجيل السلسلة النصية.
- اذهب إلى صفحة WPML > ترجمة النصوص وترجم السلسلة النصية. يجب أن تكون تحت
WordPress textdomain.