Zum Inhalt springen Zur Seitenleiste springen

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using ThemeREX Addons with WPML, you might experience a fatal PHP error on translated pages that include the Testimonials widget. The error message is:
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

Workaround

To prevent this error, make the relevant custom fields and shortcode attributes translatable.

  • Go to WPML > Settings > Custom XML Configuration in your WordPress dashboard.
  • Add the following XML configuration and save:
    <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>
            

Hinterlasse eine Antwort

Bitte bleibe beim Thema und sei respektvoll zu anderen. Wenn du Hilfe bei Problemen benötigst, die nicht mit diesem Beitrag zusammenhängen, nutze unser Support-Forum, um einen Chat zu starten oder ein Ticket einzureichen.

Du kannst diese Tags verwenden:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>