• I am writing a plugin that modifies the_content in a way which is unsuitable for feeds. I figured out that I can use the is_feed() function or the $doing_rss global var to determine something about feeds. Question is, what does each do?

    If I access my site they both return false, if I access example.com/?feed=rss or example.com/?feed=rss2 they both return ‘1’. If I access example.com/wp-feed.php is_feed() returns false but $doing_rss = ‘1’.

    So what do I use to identify that the_content is going to a feed?

    Thanks,
    Adi

Viewing 1 replies (of 1 total)
  • At glancing the code, it seem that there are two entry points to feed content. Anyway, just check for either condition.

    if (is_feed() || $doing_rss) {
    ...
    }

Viewing 1 replies (of 1 total)
  • The topic ‘is_feed() or $doing_rss – What is the difference?’ is closed to new replies.