[wp-hackers] Is there a post content action hook?
Michael Harris
harrismw at huridocs.org
Tue Oct 7 16:04:25 GMT 2008
On Tue, Oct 7, 2008 at 5:54 PM, Aaron Brazell <emmensetech at gmail.com> wrote:
> On Tue, Oct 7, 2008 at 11:51 AM, Michael Harris <harrismw at huridocs.org>wrote:
>
>> Is there an action hook that will be called before or after the post
>> content is displayed?
>>
>> I don't want or need the filter that applies to the post title or to
>> the content. A simple reason for this, is that the_content filter is
>> applied when getting an excerpt.
>>
>> I wish to display information before or after a post using a plugin,
>> and it is not feasible to use themes, due to the fact that the plugin
>> is meant to be generic (and not tied to one theme).
>>
>> "the_content filter gets applied to the content before it trims off
>> the end. It has to do this, because the raw content may contain things
>> that control formatting or replacement of words and such and you don't
>> want those to be bypassed just because you're getting an excerpt." -
>> http://wordpress.org/support/topic/115198
>>
>
> I'm pretty sure I've used the_content as an action as well. Try it and see.
> 99% sure though.
Yes, you can use the_content as an action, however, as far as I can
tell, it just works the same way. That is, when using get_the_excerpt
and there is no explicit excerpt, it will use the post content,
/after/ it has been filtered (i.e. after information that shouldn't be
displayed in the excerpt has been added), whether you use add_action
or add_filter doesn't appear to matter.
Michael.
More information about the wp-hackers
mailing list