Uncaught TypeError: b(...).not(...).filter(...).mediaelementplayer is not a function


我在WordPress最新更新4.9之后遇到此问题。我正在插件中使用此库,以允许用户使用wp媒体上传功能上传图像。它工作正常,但是在最新更新之后,它返回了我上面提到的错误。

最佳答案

通过在functions.php文件中添加以下代码,应解决错误。

add_action('wp_enqueue_scripts', 'my_register_javascript', 100);

function my_register_javascript() {
  wp_register_script('mediaelement', plugins_url('wp-mediaelement.min.js', __FILE__), array('jquery'), '4.8.2', true);
  wp_enqueue_script('mediaelement');
}

关于wordpress - WordPress媒体库不起作用-mediaelementplayer不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47346965/

10-12 21:48
查看更多