ReferenceError: _ is not defined

前端 未结 3 2053
粉色の甜心
粉色の甜心 2020-12-14 15:04

I am using a jQuery based WordPress Twitter widget and receive the error \"ReferenceError: _ is not defined\".

Am not sure how to declare the variable \

3条回答
  •  鱼传尺愫
    2020-12-14 15:09

    i was facing the same problem in the wp-admin section of the site. I enqueued the underscore script cdn and it fixed the problem.

    function kk_admin_scripts() {
        wp_enqueue_script('underscore', '//cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.min.js' );
    }
    add_action( 'admin_enqueue_scripts', 'kk_admin_scripts' );
    

提交回复
热议问题