Running PHP code from Text Widget in WordPress
-
I’m using a child theme for twenty-twelve. I had added the following code that allowed me to add php code while using the text widget
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);This worked fine until the latest release, now there is an editor telling me I can’t save the code until I use escape codes for the < and > brackets. If I do that the code doesn’t work. How do I shut down the editor so I can use the php override?
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Running PHP code from Text Widget in WordPress’ is closed to new replies.