WordPress.org

Ready to get started?Download WordPress

Forums

Change Action in RSS (4 posts)

  1. Chris Roberts
    Member
    Posted 8 years ago #

    I've got a plugin that works on the_content of a post. I'm wanting to come up with a way to tell whether or not the_content is being generated for display in an RSS reader so I can prevent the plugin from doing some things it would do in a browser. Is there a good way to tell whether or not the post is being generated for the feed?

    Thanks,
    Chris

  2. maerk
    Member
    Posted 8 years ago #

    Look at the source code of the feed output?

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    I have not tested it, but I think you should be able to do:

    function your_function()
    {
    global $doing_rss;
    if ($doing_rss == 1)
    // we're doing RSS
    else
    // we're not
    ...

    Now, this does assume that you're giving people the correct feed links. example.com/blog/feed, example.com/blog/feed/atom and so forth..

  4. Chris Roberts
    Member
    Posted 8 years ago #

    Otto,

    That sounds along the line of what I'm looking for. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags