Home › Forums › Back End › Code In WordPress › Re: Code In WordPress
June 26, 2010 at 10:50 pm
#78900
Makeshift
Member
Here’s what I’d do..
put this in your functions file:
Code:
function callback($buffer){
$convert = “/([<])(.*)([>])/”;
$replace = “<$2>”;
$buffer = preg_replace($convert, $replace, $buffer);
return $buffer;
}
$convert = “/([<])(.*)([>])/”;
$replace = “<$2>”;
$buffer = preg_replace($convert, $replace, $buffer);
return $buffer;
}
and this goes after your opening pre tag:
Code:
and this before the closing pre tag:
Code:
the function will convert all of the brackets into the entities.