The MU forums have moved to WordPress.org

Exclude / excluding from your rss feed (1 post)

  1. delayedinsanity
    Member
    Posted 15 years ago #

    I'm looking to exclude categories from the rss feed, and I'd like to do it quietly if I can (ie, behind the scenes, and not using a query string that can easily be removed from the feed link by the viewer).

    I dissected some code from some old plugins that claimed this ability, and tried hooking into 'pre_get_posts', but apparently that isn't called by the feed handler anymore (if it ever was?). I'm having trouble tracking down a filter that could be used in this situation.

    Currently the code is as simple as this;

    function exclude_vendors ($q) {
    	if ($q->is_feed) {
    		$q->set('cat', get_option('excluded_vendors'));
    	}
    }
    add_filter ('????', 'exclude_vendors');

    Any ideas? Other ways of going about this (not using feed_link or appending a query string)?

About this Topic

  • Started 15 years ago by delayedinsanity