Forum Replies Created

Viewing 1 replies (of 1 total)
  • @michael Visser: Sorry, but you also forgot the closing pre tag.

    Here’s the code that works for me ATM.

    //	return preg_replace("/<pre(.*?)>(.*?)<\/pre>/ise",
    //		"'<pre class=\"wp-code-highlight prettyprint$line_numbers\">'.wch_stripslashes('$2').'</pre>'", $content);
    return preg_replace_callback("/<pre(.*?)>(.*?)<\/pre>/is",function($m) { return '<pre class="wp-code-highlight prettyprint'.$line_numbers.'">'.wch_stripslashes($m[2]).'</pre>'; },$content);
Viewing 1 replies (of 1 total)