WPML
الحالة
محلولة
أُبلغ عنها لـ
WPML Multilingual CMS 4.6.6
الإضافة/القالب ذو الصلة
Divi
وسوم الموضوع
ATE, Compatibility

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

عند استخدام قالب Divi، ستلاحظ أنه عند ترجمة نص زر يحتوي على فاصلة عليا باستخدام WPML، تُعرض الفاصلة العليا ككيان HTML.

حل بديل مؤقت

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


  • أضف الكود التالي إلى ملف functions.php الخاص بقالبك:
    // WPML workaround for compsupp-7001
    add_filter('do_shortcode_tag', 'wpml_compsupp7001_decode_et_pb_button_text', 10, 4);
    
    function wpml_compsupp7001_decode_et_pb_button_text($output, $tag, $attr, $m) {
        if ( class_exists('Sitepress') && 'et_pb_button' === $tag && isset($attr['button_text'])) {
            // Decode both the ampersand and the apostrophe
            $output = html_entity_decode($output, ENT_QUOTES, 'UTF-8');
        }
    
        return $output;
    }

ملاحظة، ضع في اعتبارك أنه إذا كنت تستخدم زر Slider، فستحتاج إلى استخدام هذا السطر:

    if ( class_exists('Sitepress') && 'et_pb_slide' === $tag && isset($attr['button_text'])) {

بدلاً من:
    if ( class_exists('Sitepress') && 'et_pb_button' === $tag && isset($attr['button_text'])) {

وإذا كنت تستخدم عنصر Accordion، فستحتاج إلى استخدام هذا السطر:

    if ( class_exists('Sitepress') && 'et_pb_accordion_item' === $tag && isset($attr['title'])) {

بدلاً من:
    if ( class_exists('Sitepress') && 'et_pb_button' === $tag && isset($attr['button_text'])) {

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