Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Code In WordPress Re: Code In WordPress

#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;
}

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.