Php Wordpress自定义iframe短代码无法返回iframe

Php Wordpress自定义iframe短代码无法返回iframe,php,wordpress,Php,Wordpress,基本上,我想创建一个短代码,将iframe添加到apst/page等中。 我尝试了以下方法,但由于某些原因,框架显示为空白 //custom added functions add_shortcode('wrap', 'addWrapper'); function addWrapper($atts,$content=null){ extract(shortcode_atts(array( "src" => 'http://google.com',

基本上,我想创建一个短代码,将iframe添加到apst/page等中。 我尝试了以下方法,但由于某些原因,框架显示为空白

//custom added functions
add_shortcode('wrap', 'addWrapper'); 
function addWrapper($atts,$content=null){
    extract(shortcode_atts(array(
        "src" => 'http://google.com',
        "height" => '300',
        "width" => '400',
        "scrolling" => 'auto'
    ), $atts));

    return '<div id="iwrapper">
        <iframe src="'.$src.'" height="'.$height.'"  width="'.$width.'" scrolling="'.$scrolling.'"></iframe>
        </div>';
//自定义添加的函数
add_shortcode('wrap','addWrapper');
函数addWrapper($atts,$content=null){
提取(短码)附件(数组)(
“src”=>'http://google.com',
“高度”=>“300”,
“宽度”=>“400”,
“滚动”=>“自动”
)美元(附件);;
返回'
';
如果我尝试返回任何其他内容,例如一个简单的HELLO WORLD文本,它会很好地返回。为什么wordpress会将iframe清空?我也尝试手动发送iframe,但没有(

当我使用firebug来消除bug时,我没有看到任何错误:S

 <div id="iwrapper">
<iframe src="http://google.com" height="300" width="400" scrolling="auto"/>
</div>


Wordpress有一些安全限制可以删除iframe。但是,通过上面的示例很难看出您是如何加载iframe的。您正在构建Wordpress插件吗?

事实上,我刚刚打开了functions.php(属于标准主题之一,如twenty-eleven主题),然后输入。我想先试着让它工作,然后试着用它构建一个插件。我下载了一些其他iframe插件,看看它们是如何工作的,但大多数插件都像我一样返回了iframe代码。难道没有办法绕过这些安全限制吗?另外,如果我不添加网页,而是添加一个视频元素作为so例如,如果我把src=,它就会显示出来,但是如果我把eg:www.google.com作为源,它就不是:S