Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: img tags


meeciteewurkor
Member

@meeciteewurkor

what about the encode_bad function in the same formatting-functions.php file?

It has the same list of default allowed html tags. I don’t know enough php yet to understand what it does, though?

Maybe the img tag needs to be placed here as well?

function encode_bad( $text ) {

$text = wp_specialchars($text);

$text = preg_replace('|<(/?strong)>|', '<$1>', $text);

$text = preg_replace('|<(/?em)>|', '<$1>', $text);

$text = preg_replace('|<(/?a.*?)>|', '<$1>', $text);

$text = preg_replace('|<(/?ol)>|', '<$1>', $text);

$text = preg_replace('|<(/?p)>|', '<$1>', $text);

$text = preg_replace('|
|', '
', $text);

$text = preg_replace('|<(/?ul)>|', '<$1>', $text);

$text = preg_replace('|<(/?li)>|', '<$1>', $text);

$text = preg_replace('|<(/?blockquote.*?)>|', '<$1>', $text);

$text = preg_replace('|<(/?code)>|', '<$1>', $text);

$text = preg_replace(“|(.*?)|se”, “‘' . encodeit('$1') . '‘”, $text);

return $text;

Skip to toolbar