Skimming your question briefly: is there any particular reason you can't use get_the_content()?<div><br></div><div>Chip<br><br><div class="gmail_quote">On Thu, Aug 11, 2011 at 9:59 AM, Claude Needham <span dir="ltr"><<a href="mailto:gxxaxx@gmail.com">gxxaxx@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">A comment was made in a recent thread expressing the opinion that<br>
using core WP functions were *always* preferred to rolling your own.<br>
This is a slight restatement. Chip's actual statement is at the bottom<br>
of this email. Point is this reminded me that I am not comfortable<br>
with some of the design solutions I have been using recently.<br>
<br>
I'll give you an example. In a recent special page I had need for a<br>
string of the_content.<br>
<br>
Because the_content does not have an option for echo=false, I was<br>
forced to reproduce the innards of the function.<br>
$mycontent = get_the_content();<br>
$mycontent = apply_filters('the_content', $mycontent);<br>
$mycontent = str_replace(']]>', ']]&gt;', $mycontent);<br>
.... do stuff with $mycontent<br>
<br>
This means that if a fix is applied to the_content function my theme<br>
will not automatically have the advantage of the update. There are<br>
quite a few functions with forced echo: the_content, the_excerpt,<br>
post_class, body_class, the_meta, and the_guid.<br>
<br>
I'm thinking there is a different design solution that I should be<br>
using. Or, could it be that adding echo=false is somewhere in queue<br>
for future release?<br>
<br>
Just wondering about the best practices here.<br>
<br>
Regards,<br>
Claude Needham<br>
<br>
<br>
Proper quote as promised.<br>
On Thu, Aug 11, 2011 at 5:57 AM, Chip Bennett <<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>> wrote:<br>
> In general, though, IMHO, it is *always* preferable to use a core WP<br>
> function for content filtering and/or untrusted data<br>
> sanitization/validation.<br>
> Chip<br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</blockquote></div><br></div>