WordPress.org

Ready to get started?Download WordPress

Forums

Restrict plugin/filter to work only on custom RSS feed (6 posts)

  1. quarkz
    Member
    Posted 6 years ago #

    Hi
    I am trying to figure out how I can restrict my plugin/filter to work on a custom RSS2 feed. At the moment, when I activate my plugin it affects all RSS feed outputs. I would like to affect only the output of the custom RSS.

    Any suggestions ? Thanks

  2. Kafkaesqui

    Posted 6 years ago #

    Well, how are you 'calling,' or what exactly defines, the custom feed? Are you passing a query var (i.e. $_GET) the plugin watches for?

  3. quarkz
    Member
    Posted 6 years ago #

    No, not at the moment.

    The custom feed needs to have a different size image as compared to the regular feed. I was using a plugin/filter to resize the images(which works fine) but I need ONLY the custom feed to have the updated image size.

  4. Kafkaesqui

    Posted 6 years ago #

    Perhaps if you set a PHP constant with the custom feed, and test on this along with (I assume) is_feed().

    Reference:
    http://php.net/language.constants

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Well, how you do it really depends on how you're generating this "custom feed". We need to know more about how your feed works.

  6. quarkz
    Member
    Posted 6 years ago #

    Thanks for your inputs.I'll try out the constant option.

    The custom feed template is the same as the rss2 feed. The only thing different would be the image sizes.I would like my plugin to affect only the output of the custom RSS.

    Any other options I could look at to generate 2 different outputs from same rss2 feed ?

Topic Closed

This topic has been closed to new replies.

About this Topic