Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#23677 closed enhancement (fixed)

Feed autodiscovery for custom taxonomy and perhaps date archives

Reported by: mdgl's profile mdgl Owned by: stevenkword's profile stevenkword
Milestone: 4.5 Priority: normal
Severity: normal Version: 3.5
Component: Feeds Keywords: has-patch
Focuses: Cc:


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.

Attachments (3)

23677-taxonomy.diff (1.3 KB) - added by mdgl 11 years ago.
Suggested patch to add autodiscovery of feeds for custom taxonomy archives.
23677-refresh.diff (1.3 KB) - added by stevenkword 9 years ago.
23677-refresh.2.diff (1.3 KB) - added by stevenkword 8 years ago.
Refresh relative to /src

Download all attachments as: .zip

Change History (10)

11 years ago

Suggested patch to add autodiscovery of feeds for custom taxonomy archives.

#1 @iseulde
11 years ago

  • Component changed from General to Feeds

#2 @stevenkword
9 years ago

  • Keywords has-patch added

#3 @stevenkword
9 years ago

  • Owner set to stevenkword
  • Status changed from new to assigned

This looks good to me and has been refreshed in 23677-refresh.diff

Version 0, edited 9 years ago by stevenkword (next)

#4 @stevenkword
9 years ago

@wonderboymusic Would you mind taking a look to see if you have any additional thoughts on this?

8 years ago

Refresh relative to /src

#5 @stevenkword
8 years ago

  • Milestone changed from Awaiting Review to 4.5

This ticket was mentioned in Slack in #core by jorbin. View the logs.

8 years ago

#7 @jorbin
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 36671:

Make Custom Taxonomy Feeds Auto-discoverable

This helps improve the parity between custom taxonomies and built in taxonomies. It is one small step to #makeCustomTaxonomyFeedsGreatAgain.

Fixes #23677
Props mdgl, stevenkword

Note: See TracTickets for help on using tickets.