WPML
סטטוס
נפתר על ידי המפתח
תוסף/ערכת עיצוב קשורים
ThemeREX Addons
תגיות נושא
Compatibility

סקירה כללית של התקלה

בעת שימוש ב־ThemeREX Addons עם WPML, ייתכן שתיתקל בשגיאת PHP קריטית בדפים מתורגמים הכוללים את הווידג’ט Testimonials. הודעת השגיאה היא:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in .../wp-content/plugins/trx_addons/cpt/testimonials/tpl.default-item.php:33

פתרון עוקף

כדי למנוע שגיאה זו, הגדר את השדות המותאמים אישית ואת תכונות השורטקוד הרלוונטיים כניתנים לתרגום.


  • עבור אל WPML > הגדרות > הגדרות XML מותאמות אישית בלוח הבקרה של WordPress.

  • הוסף את תצורת ה־XML הבאה ושמור:
    <wpml-config>
      <custom-fields>
        <custom-field action="translate">trx_addons_options</custom-field>
      </custom-fields>
      <shortcodes>
        <shortcode>
          <tag>trx_sc_testimonials</tag>
          <attributes>
            <attribute type="taxonomy-ids" sub-type="cpt_testimonials_group">cat</attribute>
            <attribute type="post-ids" sub-type="cpt_testimonials">ids</attribute>
            <attribute>subtitle</attribute>
          </attributes>
        </shortcode>
      </shortcodes>
    </wpml-config>
            

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