wordpress让文本小工具支持PHP代码
add_filter(‘widget_text’, ‘do_shortcode’);
//让文本小工具支持PHP代码
add_filter(‘widget_text’,’execute_php’,100);
function execute_php($html){
if(strpos($html,”<“.”?php”)!==false){
ob_start();
eval(“?”.”>”.$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}
继续阅读
- 上一篇 >:深度系统v15.4正式发布,惊艳眼球
- 下一篇 >:nginx 多条件联合判断的变通之法