Feed autodiscovery for custom taxonomy and perhaps date archives
|Reported by:||mdgl||Owned by:|
In #21648 we enabled the "autodiscovery" of feeds for custom post types. Further review of this solution reveals a few remaining issues:
a) Function feed_links_extra() in file wp-includes/general-template.php still does not add <link> tags for autodiscovery of either custom taxonomy archives or date (year/month/day) archives. You can argue that feeds for date archives might not be particularly useful, but they are generated, so why do we not provide links to them? A helper function does exist to obtain the link for custom taxonomy archive feeds, but there is no corresponding support for date archives.
b) The helper functions for obtaining feed links in file link-template.php are not particularly easy to use, requiring much examination of the queried object. If a theme or plugin wishes to include explicit hyperlinks to feeds (i.e. <a> tags) then it is presently forced to duplicate much of the code from function feed_links_extra(). I suggest the bulk of the code from here should be moved into a new function within link-template.php where it can be reused to generate either <link> or <a> tags as needed.
c) We seem to have a helper function for feeds containing search results with comments (get_search_comments_feed_link() in wp-includes/link-template.php). Whilst this feed is generated, it's not clear why "search" is treated specially here and why if this was considered useful there are no corresponding feeds for comments on other archives.