【发布时间】:2012-08-15 20:05:15
【问题描述】:
我为 wordpress 制作了一个简码,functions.php 中的代码如下所示:
return '<div class="video-shortcode"><iframe width="600" height="365" src="/watch.php?file=' . $atts['file'] . '&img=' . $atts['img'] . '" frameborder="0" scrolling="no" allowfullscreen></iframe></div>';
当我使用它时,帖子中的源代码应该是这样的:
<iframe width="600" height="365" src="/watch.php?file=myfile.mp4&img=myimg.jpg" frameborder="0" scrolling="no" allowfullscreen></iframe>
但由于某种原因,“img”之前的 & 符号如下所示:
&
【问题讨论】:
-
只是有点谷歌搜索...wordpress.org/support/topic/…
-
这不是我的问题...我的问题在于替换代码,而不是短代码
-
你能发布整个输出吗?不仅仅是&符号的样子?
-
<div class="video-shortcode"><iframe width="600" height="365" src="/watch.php?file=7002_504_720p.mp4&#038;img=/public/images/ss12preview.jpg" frameborder="0" scrolling="no" allowfullscreen></iframe></div> -
@Matt 这样吗?你有什么想法吗?
标签: php html wordpress function shortcode