【发布时间】:2017-05-28 20:05:14
【问题描述】:
我正在开发一个 wordpress 门户。
我正在从前端页面发送带有 ajax 的 html 内容(youtube iframe)。 但是,当我插入该帖子时,wp_insert_post 会删除其中的 iframe 代码。 ajax或其他地方没有问题。我猜有某种过滤器。
如何禁用它并插入 iframe 代码?
插入前的代码 -> $_POST["content"]
<div class="line nVideo" style="text-align: center;" ><iframe id="player" type="text/html" width="650px" height="380px" src="http://www.youtube.com/embed/mY8BZsIgg74?showinfo=1&enablejsapi=1&color=white&origin=http://432designstudio.com" frameborder="0" allowfullscreen=""></iframe></div><div id="empty-line" class="nText " ><div>gasdgdsag</div>
插入后我再次调用内容 -> get_post_field('post_content', $postID)
<div class="line nVideo" style="text-align: center"></div><div id="empty-line" class="nText "><div>gasdgdsag</div>
【问题讨论】:
标签: wordpress iframe wordpress-theming custom-wordpress-pages