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?