Visual composer doesn't load and gives TypeError: _.template(…).trim is not a function

前端 未结 11 1412
孤街浪徒
孤街浪徒 2021-02-05 11:07

My visual composer plugin doesn\'t work. It stuck on the loading page. And it gives an error \"TypeError: .template(...).trim is not a function\" Error is on this line of co

11条回答
  •  故里飘歌
    2021-02-05 11:40

    If you are unable to solve this error by upgrading or downgrading your theme or plugin, you could at least make the below changes.

    1. Open the following two files:

    wp-content\plugins\js_composer\assets\js\frontend_editor\frontend_editor.js
    wp-content\plugins\js_composer\assets\js\frontend_editor\custom_views.js
    

    2. Replace

    this.$controls = $( _.template( template, data, vc.template_options ).trim() ).addClass( 'vc_controls' );
    

    with

    this.$controls = $( ( "vc.template_options" ).trim() ).addClass( 'vc_controls' );
    

    This will surely work.

提交回复
热议问题