Then can you just use add_filter( 'the_content', 'mytheme_filter_the_content' ), where<div><br></div><div>function mytheme_filter_the_content( $content ) {</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// Some conditional wrapper to filter only</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// in the correct context. For example, you</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// could query post custom meta, and determine</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// if the current page is a static Page, and whether</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// the current page is using your specific</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// custom page template.</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// Query the post metadata</div><div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>$pagetemplate = get_post_meta( $post->ID, '_wp_page_template', true );</div></div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>// Check to see if the current page uses the specific custom page template</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span>if ( 'page-special-template.php' == $pagetemplate ) {</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span><span class="Apple-tab-span" style="white-space: pre; ">        </span>// Filter the_content here!</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span>}</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>return $content;</div><div>}<br><br><div class="gmail_quote">On Thu, Aug 11, 2011 at 10:15 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;">I guess I wanted to keep the apply_filters, and the str_replace that<br>
is found in the_content in place.<br>
<br>
I wanted to leave everything exactly how it would be if the_content<br>
was called, then do a small bit of post grab pre echo processing.<br>
<br>
Was basically trying to respect the core functions since I only<br>
understand about 10% of what is going on in the core.<br>
<font color="#888888"><br>
Claude<br>
</font><div><div></div><div class="h5"><br>
On Thu, Aug 11, 2011 at 8:08 AM, Chip Bennett <<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>> wrote:<br>
> Skimming your question briefly: is there any particular reason you can't use<br>
> get_the_content()?<br>
> Chip<br>
><br>
> On Thu, Aug 11, 2011 at 9:59 AM, Claude Needham <<a href="mailto:gxxaxx@gmail.com">gxxaxx@gmail.com</a>> wrote:<br>
>><br>
>> 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>><br>
>> 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>
><br>
><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>
><br>
><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>
</div></div></blockquote></div><br></div>