- Статус
- Решено автором
- Связанный плагин/тема
- 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>