使用add_filter方法时禁用页脚窗口小部件

时间:2015-06-18 13:03:57

标签: php html wordpress

我使用以下代码在WordPress小部件中使用PHP。 PHP代码已完成并按预期运行,但我的页脚小部件仍处于禁用状态。

function php_execute($html) {
    if (strpos($html,"<"."?php")!==false) {
        ob_start(); eval("?".">".$html);
        $html=ob_get_contents();
        ob_end_clean();
    }
    return $html;
}
add_filter('widget_text','php_execute',100);

0 个答案:

没有答案
相关问题