WordPress.org

Ready to get started?Download WordPress

Forums

Content Filter - For site not feed. (4 posts)

  1. Thomas McMahon
    Member
    Posted 7 years ago #

    I'm building a plugin and it adds code to the content via the content filter and it works great. However it also adds content to the feed when that's called.

    How can I ensure that my filter only runs in web mode not in feed mode?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    In your plugin:

    if (!is_feed())
    {
    // do your stuff
    }

  3. Thomas McMahon
    Member
    Posted 7 years ago #

    Thanks Otto42. My guess is that WordPress only updates the feed ever so many minutes so I'll have to wait for that. :)

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Actually, WordPress creates the feed on demand. There's no update process to speak of.

    Now, if you're using WP-Cache or routing through feedburner or something, then yes, that might cause a delay.

Topic Closed

This topic has been closed to new replies.

About this Topic