[wp-hackers] Reason for Replacement in the_content()

Charles K. Clarkson cclarkson at htcomp.net
Wed Aug 5 15:18:00 UTC 2009


In the the_content() function there is a string replacement after the filter
for ']]>'. Anyone know what it is for? What case is it catching? The only
case I can think of is JavaScript tags, but why do that?

<script type="text/javascript"><!--//--><![CDATA[//><!--

function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') {
     $content = get_the_content($more_link_text, $stripteaser, $more_file);
     $content = apply_filters('the_content', $content);
     $content = str_replace(']]>', ']]&gt;', $content);
     echo $content;


Charles Clarkson
Mobile Home Investor
Free Market Advocate

I'm not really a smart person. I just play one on the Internet.

Stephenville, TX
+1 (254) 968-8328

More information about the wp-hackers mailing list