【发布时间】:2014-07-10 18:10:04
【问题描述】:
我添加了以下函数来在我的主题页面中呈现一个 Wordpress 编辑器:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<?php wp_editor( $content, 'editor', $settings = array() ); ?>
<!-- scripts -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>
好处是它为页面添加了一个工作编辑器。但是“添加媒体”按钮不起作用。我尝试了一些方法:为编辑器添加额外的自定义 Wordpress JS,但仍然没有结果。
Javascript 控制台输出:
Uncaught TypeError: Cannot read property 'audio' of undefined (media-views.min.js?ver=3.9.1:1)
Uncaught TypeError: Cannot read property 'id' of undefined (media-audiovideo.min.js?ver=3.9.1:1)
【问题讨论】:
标签: javascript php jquery wordpress wordpress-theming