[wp-hackers] Filter post (the_content), but not excerpt (the_excerpt)

Aaron D. Campbell wp-hackers at ezdispatch.com
Wed Jan 10 19:47:53 GMT 2007


Aaron D. Campbell wrote:
> I'm trying to figure out how I can filter a posts content, without 
> filtering an excerpt.  I know that I can check is_archive to see if 
> I'm in an archive (which usually uses excerpts), but it seems like 
> there must be a way to do this.  I tried attaching to the_excerpt, and 
> setting a static variable that my function attached to the_content 
> could check, but it seems that the "the_content" filters are executed 
> BEFORE the the_excerpt filters.  Is there some way to do this now, or 
> can we set some sort of variable that can be used to see if WordPress 
> is going to turn the post into an excerpt?
Well, I didn't get a response, but I DID find the solution.  It was to 
put a priority of one on the filter that I attached to 'get_the_excerpt'

You can see it used in my Attachment Manager Plugin:
http://xavisys.com/blog/2007/01/05/wordpress-attachment-manager-plugin/


More information about the wp-hackers mailing list