Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Keeping some comments..

$
0
0

Replies: 1

I wanted to keep some comments like <!–googleoff: all–>

So I added this code in replacement from the old:

if ($minify_html_comments != 'no') {
  $process = preg_replace('/(<!--{)(.*)(}-->)/','@#_###{$2}###_#@', $process);
  $process = preg_replace('/<!--(?!\s*(?:\[if [^\]]+]|<!|>))(?:(?!-->).)*-->' . $mod, '', $process);
  $process = preg_replace('/(@#_###{)(.*)(}###_#@)/','<!--$2-->', $process);
}

Then I rewrote the comment as: <!–{googleoff: all}–>
And now it keeps the comment. 🙂

Just thought I would share.


Viewing all articles
Browse latest Browse all 59525

Trending Articles