[wp-hackers] re-thinking about the way filters work

David Chait davebytes at comcast.net
Sat Jun 25 21:49:48 GMT 2005


Ummm.  Guess that's one way, but maybe there needs to be yet-another filter, the_excerpt_content, or something like that, for the generated exerpt.  Also, realize that some folks like me write plugins that use the "get_zzzz" versions of things, so if you are hooking the_excerpt but not get_the_excerpt, the plugin won't necessarily get a properly-processed excerpt (although in this case, it's probably the correct result... highlighting shouldn't affect 'more direct' retrieval, just the 'generic page output tags'.

-d
  ----- Original Message ----- 
  From: Amit Gupta 
  To: wp-hackers at lists.automattic.com 
  Sent: Saturday, June 25, 2005 4:41 PM
  Subject: [wp-hackers] re-thinking about the way filters work



  as being discussed at this forum post
  http://wordpress.org/support/topic/37331
  there seems to be a problem in the functioning of 'the_excerpt' & 'the_content' filters. The thing is that if there's no excerpt for a post, 'the_content' is used by 'the_excerpt' to create an excerpt. so far its ok, but the problem is that the excerpt created has the filters applied to it which were for 'the_content' & then the filters meant for 'the_excerpt' are applied. But if there are one or more filters that are same for 'the_content' & 'the_excerpt' (as in my plugin's case, ig:Syntax Hiliter), there comes the problem with the plugin not working correctly on the excerpt.


  Proposed Solution:-
  -----------------------
  The logical way would be that 'the_content' filters are not applied to the excerpt generated by 'the_content' as at that time, 'the_content' is not the target entity but is merely acting as a conduit for 'the_excerpt' to generate an excerpt from the DB. So when 'the_content' & 'the_excerpt' are treated as seperate entities by allowing different filters on each, then why not allow it in the right way? else what's the use of having 'the_excerpt' filter when 'the_content' filter is gonna be applied to the excerpt??
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050625/a4126351/attachment.html


More information about the wp-hackers mailing list