WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#4595 closed enhancement (wontfix)

Format of feed (RSS, Atom) should be an option

Reported by: terraces Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.3
Component: Feeds Keywords: needs-patch close
Focuses: Cc:

Description

Summary

Currently, WordPress uses RSS 2.0 as the default format for its syndication feeds
In case anyone wants a different default format, he must hack Wordpress core (or tell users to use /feed/type rather than /feed, but he still needs to change any page / template that links to the feeds).
This patch allows users to choose default RSS type in the admin interface, in the Options / Reading page.

Version

This patch has been created from the current 2.3 SVN code (trunk).

Modified files

  • wp-includes/feed.php: Adds a wp_dropdown_feeds() method, that lists available feed types within <option> items to be used in a <select> list
  • wp-admin/options-reading.php: Displays the <select> list in the RSS options form to let user choose default type. Chosen type is saved as 'rss_format' in the wp_options table
  • wp-includes/functions.php: Use get_options('rss_format') rather than 'rss2' default for feed type

Attachments (6)

rss-patch.txt (2.6 KB) - added by terraces 7 years ago.
4595.diff (2.2 KB) - added by Nazgul 7 years ago.
4595-defaultoption.2.diff (1.9 KB) - added by Otto42 7 years ago.
default_rss_format patch
4595-defaultoption.diff (1.9 KB) - added by Otto42 7 years ago.
default_rss_format patch
4595-feed-format.diff (2.0 KB) - added by lloydbudd 6 years ago.
default_feed_to_atom.zip (535 bytes) - added by peaceablewhale 5 years ago.

Download all attachments as: .zip

Change History (24)

terraces7 years ago

comment:1 foolswisdom7 years ago

Hi terraces,

Thank you for contributing to WordPress!

I didn't think this option should be part of the UI, because for almost all people the option is not useful. I would suggestion adjusting the patch to leave it as something that can be set in wp-admin/options.php if really desired.

comment:2 terraces7 years ago

Hi,

Whant do you mean exactly ? I can't see anything that can be directly set in options.php ? Is there another way to save this "RSS type" option in database ? (which is what my patch tries to do)

Thanx

comment:3 Nazgul7 years ago

foolswidon proposes a solution that's somewhere between the current situation and your solution.

Make the feed type an option, but don't add a UI for it to Options - Reading. More options equals more difficult to use, especially with settings that don't mean anything to a large part of our userbase. The power users that do care can change the option through options.php. Not as easy to use, but we're talking about power users anyway.

You could even create a plugin on top of that, which integrates with the GUI, so people that are interested in their feed type can change it easily as well.

Nazgul7 years ago

comment:4 Nazgul7 years ago

I've attached a patch for the "option without GUI" possible solution.

comment:5 ryan7 years ago

  • Milestone changed from 2.3 to 2.4 (next)

comment:6 Otto427 years ago

+1 for hidden option, but I would use default_rss_format as the name of the option.

Complete patch for trunk attached.

Otto427 years ago

default_rss_format patch

Otto427 years ago

default_rss_format patch

comment:7 lloydbudd6 years ago

  • Keywords suggested-improvement removed

Relates to #5328.

comment:8 rubys6 years ago

  • Cc rubys added

comment:9 lloydbudd6 years ago

  • Summary changed from Allow users to choose type of RSS feeds to Format of feed (RSS, Atom) should be an option

lloydbudd6 years ago

comment:10 lloydbudd6 years ago

I understand the naming used by Otto42, it's consistent with other options that begin rss, but time to move fwd ;-) And 'default' seems unnecessary in option name, particularly when sometime it means can be over written by post specific options.

comment:11 ffemtcj6 years ago

  • Milestone changed from 2.5 to 2.6

comment:12 follow-up: Otto426 years ago

lloyd: I would have no problem with "default_feed_format", however it is actually a default, because it can be overridden by the user requesting the feed (not on a per-post basis). If the user gets /feed/atom, then they get an atom feed, regardless of the setting.

Will refresh this for trunk if anybody is interested.

comment:13 in reply to: ↑ 12 ; follow-up: lloydbudd6 years ago

Replying to Otto42:

however it is actually a default, because it can be overridden by the user
requesting the feed (not on a per-post basis). If the user gets /feed/atom,
then they get an atom feed, regardless of the setting.

Default in the context of options seems to be when it can be overriden on a per post basis, or otherwise in the UI.

comment:14 in reply to: ↑ 13 lloydbudd6 years ago

Replying to lloydbudd:

Default in the context of options seems to be when it can be overriden on a per post basis, or otherwise in the UI.

Bah, but in the context of the functions it is default_feed, so you win ;-)

comment:15 Denis-de-Bernardy5 years ago

  • Component changed from Administration to Feeds
  • Keywords needs-patch close dup added; has-patch removed
  • Milestone changed from 2.9 to Future Release

I'm pretty sure there is a dup of this one in the Feeds component.

comment:16 follow-up: Denis-de-Bernardy5 years ago

  • Keywords dup removed

the UI should be done in a plugin imo. suggesting wontfix.

see #5802 for the rest.

comment:17 in reply to: ↑ 16 peaceablewhale5 years ago

Replying to Denis-de-Bernardy:

the UI should be done in a plugin imo. suggesting wontfix.

see #5802 for the rest.

Agree. I have attached a plugin (default_feed_to_atom.zip) to this report in case anybody needs an idea how to write the plugin.

comment:18 Denis-de-Bernardy5 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.