dosc9472 2015-07-29 18:24
浏览 56

wordpress管理菜单中的iframe

I recently came across the need to embed some videos inside of a wordpress administrative plugin. Basically, they want me to add a small menu to the wordpress admin that loads up some youtube videos in the main frame.

I'm not a wordpress developer by any means, but I do have some experience with PhP, so I managed to google myself into making this:

add_action('admin_menu', 'mt_add_pages');
function mt_add_pages() {
add_menu_page(_('Videos'), _('Events'), 'manage_options', 'mt-videos', 'mt_videos');
}

function mt_videos() {
echo ' <iframe width="100%" height="900" style="display:block;"src="http://www.youtube.com/embed/0NKUpo_xKyQ" frameborder="0">';
}

On my testbed, (wamp), this is working perfectly fine, the video shows up and plays without error. But when I upload it to our production server, the iframe is suddenly empty/invisible.

I did some snooping on the source and see that the code is there, unaltered. I also checked into the associated CSS and dont see any reason why the content would be invisible.

Using the same iframe on a page or post within the public side of the site is also working.

Any ideas?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计