WPML
ステータス
開発者により解決済み
関連するプラグイン/テーマ
ThemeREX Addons
トピックタグ
Compatibility

問題の概要

WPMLでThemeREX Addonsを使用すると、Testimonialsウィジェットを含む翻訳されたページでPHPの致命的なエラーが発生する場合があります。エラーメッセージは以下の通りです。

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

回避策

このエラーを防ぐには、関連するカスタムフィールドとショートコード属性を翻訳可能にします。


  • WordPressダッシュボードでWPML > 設定 > カスタム XML 設定に移動します。

  • 以下の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>
            

すべての既知の問題 →