[wp-testers] get_the_content usage question

Paul Robinson pablorobinson at gmail.com
Tue Mar 23 18:50:26 UTC 2010


Sorry about that Dougal, it's on the bottom of the page for the_content()

http://codex.wordpress.org/Template_Tags/the_content

I haven't had enough coffee today.

Thanks for that, just wanted to check it was still needed before using
it in my code.

Also can anyone tell me how to get the new menu system to show a link
to the home page? I tried the show_home argument, but it only seems to
work when no menu is defined in the admin (which I think is just
triggering the failsafe callback). I could be doing it completely
wrong though so please forgive my thickness.

Thanks again,
Paul.

On 23 March 2010 18:42, Dougal Campbell <dougal at gunters.org> wrote:
> On Mar 23 2010 12:54 PM, Paul Robinson wrote:
>>
>> Hi guys,
>>
>> I'm just wondering, is the entry in the codex for get_the_content
>> still relevant where it tells you to add:
>>
>> <?php
>> $content = apply_filters('the_content', $content);
>> $content = str_replace(']]>', ']]&gt;', $content);
>> ?>
>>
>> It says it hasn't been added to the core yet. Has it been added and
>> the codex just hasn't been updated yet?
>>
>
> I don't see that note on the Codex page.
>
> But to answer your question: get_the_content() returns the content *before*
> filtering. So, if you are planning to send it out to the browser at some
> point, then yes, you probably want to do the steps above.
>
> The template function the_content() does exactly that. It calls
> get_the_content(), then apply_filters(), then does the str_replace() to fix
> any parsing problems that might happen if you're trying to keep strict XML
> parsing.
>
>
> --
> Dougal Campbell <dougal at gunters.org>
> http://dougal.gunters.org/
> http://twitter.com/dougal
> http://twitual.com/
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>


More information about the wp-testers mailing list