Syndication formats like RSS and ATOM are designed to be extensible. A number of extension modules are proposed, with the purpose of increase the semantic content of syndication feeds without bloating the core format specifications.
- An incomplete list of proposed RSS 1.0 extension modules
- An incomplete list of proposed RSS 2.0 extension modules
This draft proposes an extension to the WordPress Plugin API that allows plugin developers to add custom metadata in WP-created feeds.
API extensions
Hook functions
- wp_feed_namespace
- Allows to add XML namespaces for extension modules. The hook function receives the feed type as a parameter.
- wp_feed_channel
- Executes inside the
channel
section of RSS feeds and thefeed
section of ATOM feeds. Allows to add channel-level metadata. The hook function receives the feed type as a parameter. - wp_feed_item
- Executes inside the
item
section of RSS feeds and theentry
section of ATOM feeds. Allows to add post-level metadata. Loop template tags can be used. The hook function receives the feed type and the post ID as parameters. For comments feed, the comment ID is passed as third parameter. - wp_feed_rdf
- Executes inside the root of the RDF document, for RSS 1.0 feeds only. No parameters.
Parameter values
Values for the “feed type” parameter are:
- ‘rss2′
- For RSS2 feeds
- ‘commentsrss2′
- For RSS 2.0 comments feeds
- ‘rdf’
- for RSS 1.0 feeds
- ‘atom’
- for ATOM feeds
Example
This example plugin adds trackback informations (http://madskills.com/public/xml/rss/module/trackback/) and Creative Commons informations (http://backend.userland.com/creativeCommonsRssModule – http://web.resource.org/rss/1.0/modules/cc/) in RSS and ATOM feeds.
See the results on my website’s feeds: