【发布时间】:2018-04-16 06:11:17
【问题描述】:
我正在运行一个 wordpress 插件,但我遇到了一些问题。
当我在帖子中使用此代码时,一切正常。
<iframe width="362" height="395" src="http://website.comm/<?php
if ( 0 != get_current_user_id() ) {
the_author_meta( 'user_description', get_current_user_id() );
} else {
echo 'Not logged in user';
}
?>" frameborder="0"></iframe>
但是当我尝试在该插件中使用相同的代码时,我得到了错误。 该插件正在使用 [psfd_php] [/psfd_php] 作为 php 代码。
<iframe width="362" height="395" src="http://website.comm/[psfd_php]
if ( 0 != get_current_user_id() ) {
the_author_meta( 'user_description', get_current_user_id() );
} else {
echo 'Not logged in user';
}
[/psfd_php]" frameborder="0"></iframe>
我得到的输出是这样的。
[psfd_php]
if ( 0 != get_current_user_id() ) {
the_author_meta( 'user_description', get_current_user_id() );
} else {
echo 'Not logged in user';
}
[/psfd_php]
当我尝试在没有 iframe 代码的情况下使用相同的代码时,我不会收到任何错误。 所以有问题。
这是什么? 你能帮我写出正确的代码吗?
Click here for the original discussion on wordpress.org/support.
【问题讨论】:
-
第二次尝试遇到什么错误?顺便说一句,当您插入标签属性时,您应该注意
'user_description'字段中的内容;例如,"char 的存在将关闭属性声明 -
插件是什么?网址?
-
第一篇文章有错误。 ''我得到的输出是这个''纯代码。像这样:imgur.com/OyGRTj2 插件:wordpress.org/support/topic/allow-php/#post-9645284