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

Amit Gupta amit at igeek.info
Sat Jun 25 20:41:39 GMT 2005


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??


-----
Amit Gupta

|| Canned!! -- my Atropine || iG:Syntax Hiliter v2.01 ||
|| iGEEK.INFO || Free Nokia Ringtones || Online Gaming @ Games Planet || 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050625/743846ce/attachment.html


More information about the wp-hackers mailing list