[wp-hackers] Re: RSS2 Action

Ozh ozh at planetozh.com
Tue Apr 15 07:34:58 GMT 2008


>Thanks Viper. I tried that, and it seems to work.
>
>function addAds() {
>   echo '<p>Content</p>';
>}
>
>if (is_feed())
>  add_action('the_content', 'addAds');

This won't work because:
1) when the plugin loads, is_feed() may or may not work. Test on is_feed() 
*after* everything is loaded.
2) your function addAds() will not return any content to the_content(), 
I'm not sure this is what is expected
2.1) for code readability: add_filter() instead of add_action()

Ozh




More information about the wp-hackers mailing list