wierd behaviour with applying filters
-
I’m trying to apply a filter to ‘the_excerpt’ in my syntax hiliter plugin so that the excerpts on the category/archive/search pages also have syntax hilited code.
so here’s the code for applying & removing some filters that I’m using
// disable wptexturize filter
remove_filter('the_content', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
// add conditional wptexturize
add_filter('the_content', 'dis_en_frmt');
add_filter('the_excerpt', 'dis_en_frmt');
// apply filter for syntax hiliting
add_filter('the_content', 'syntax_hilite', 2);
add_filter('the_excerpt', 'syntax_hilite', 2);
Now the problem with the above is that the code is highlighted on the pages where full content is displayed, like main page & post pages, but the Category/Archive/Search pages which use ‘the_excerpt’ don’t have syntax hilighting!! seems that the filter is not being applied. but if I comment the second last line in the above code(commenting out the filter to be applied on ‘the_content’), the code in the excerpt is hilited, meaning that the filter is applied!!
so what can be this problem? I’m testing this on WP1.5.1
can anyone help?
- The topic ‘wierd behaviour with applying filters’ is closed to new replies.