WPML
Stato
Risolto dall’autore
Plugin/tema correlato
ThemeREX Addons
Tag dell’argomento
Compatibility

Panoramica del problema

Quando usi ThemeREX Addons con WPML, potresti riscontrare un errore PHP fatale nelle pagine tradotte che includono il widget Testimonials. Il messaggio di errore è:

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

Soluzione alternativa

Per evitare questo errore, rendi traducibili i relativi campi personalizzati e gli attributi degli shortcode.


  • Vai su WPML > Impostazioni > Configurazione XML personalizzata nella tua dashboard di WordPress.

  • Aggiungi la seguente configurazione XML e salva:
    <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>
            

Tutti i problemi noti →