2016-04-14 10 views
2

これはコンソールからエラーが発生しているコードです。WP 4.5にアップデートした後のWordpressのVisual Composerエラー

/** 
    * Convert html into correct element 
    * @param html 
    */ 
    html2element:function (html) { 
     var attributes = {}, 
      $template; 
     if (_.isString(html)) { 
      this.template = _.template(html); 
      $template = $(this.template(this.model.toJSON()).trim()); 
     } else { 
      this.template = html; 
      $template = html; 
     } 
     _.each($template.get(0).attributes, function (attr) { 
      attributes[attr.name] = attr.value; 
     }); 
     this.$el.attr(attributes).html($template.html()); 
     this.setContent(); 
     this.renderContent(); 
    }, 

it causes the page editor not to load!

see the line where there is an error in the code.

私はすべてのルールを破ったり、十分な詳細に問題を説明していない場合、私は事前にお詫び申し上げます。

可能であればお申し付けください。

+1

http://stackoverflow.com/questions/36605420/plugin-throwing-typeerror-after-wordpress-4-5-update - また、これはPHPではないので、あなたのタグを見て、それはJavaScriptです – KDOT

+0

エラーが発生する可能性がありますあなたのテーマにも関連しています。あなたはどんなテーマを使っていますか? –

+0

下記の解決策は私の場合は役に立たなかった。私の解決策:Visual Composerプラグイン(4.5.3)のバンドルインストールを削除し、商用バージョン(バージョン5、コスト:$ 35)を購入し、代わりにインストールします。 –

答えて

1

私の回答hereをご覧ください。

私はにhtml2element機能を更新することにより、このバグを修正:これはあなたのために働く/wp-content/plugins/js_composer/assets/js/backend/composer-view.js

ホープ

html2element: function(html) { 
     var $template, attributes = {}, 
      template = html; 
     $template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) { 
      attributes[attr.name] = attr.value 
     }), this.$el.attr(attributes).html($template.html()), this.setContent(), this.renderContent() 
    }, 

+0

これを見ていただきありがとうございます! テーマが期限切れになっていた問題が判明したので、私はあなたの解決策を試してみませんでした! –

+0

ベン、あなたのソリューションは私にとって完璧に機能しました!どうも。 – Senya

関連する問題