“like” as in “for example”, I guess. Call it as you wish, but when correctly defined, the value after /feed/ in an URL is a “type” as far as add_feed()
is concerned. It’s intended to represent different feed specifications like Atom or RDF, but you can create your own as long as there’s some valid content type header you can send.
However, if your “type” is not one of the predefined specifications which are related to the content type header, you must also use the ‘feed_content_type’ filter to specify the proper header value. Otherwise it’ll default to “rss2” when it’s passed to “the_content_feed” filter callback, regardless of what “type” you’ve added. Regardless of what type is sent as a header, the named type that you’ve added should show up as the “feed” query var.
Given the discrepancy between what a “type” is for add_feed()
and what is passed as “type” to “the_content_feed” when the “feed_content_type” filter is not used, I agree with you that there ought to be a formal distinction between “type” and “name”. What add_feed()
does really is more of a name than a type. Unfortunately, it’s ambiguous, which isn’t the first instance of ambiguity in WP ??
I tested your add_feed()
code on my site, defining my own version of MC_newsletterRSS()
based in part on the default RSS2 template. I requested /feed/mc-newsletter/ and checked the query vars in “pre_get_posts”. Sure enough, 'feed' => 'mc-newsletter'
. However, the $type value passed to “the_content_feed” is “rss2” since I didn’t use the “feed_content_type” filter.