Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a filter or hook that is triggered just before post content is rendered?

What I'd like to do is to apply a filter to the text content of a post just before the post text is being rendered.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Can you not simply use the_content filter hook?

function mytheme_content_filter( $content ) {
     // Do stuff to $content, which contains the_content()
     // Then return it
     return $content;
}
add_filter( 'the_content', 'mytheme_content_filter' );
share|improve this answer
1  
That's simply the filter I was looking for. –  Luke Jul 8 '11 at 21:04
    
Resurrecting this old thread to notice that, by using the filter, all tags get stripped. How can I keep my tags? –  Ciprian Nov 13 '12 at 9:17
    
@CiprianPopescu I would recommend starting a new question. It sounds to me like your issue isn't necessarily related to this question or answer. Adding your own question would allow you to elaborate more on the exact nature of your issue. –  Chip Bennett Nov 13 '12 at 14:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.