Phillip Pearson - web + electronics notes

tech notes and web hackery from a new zealander who was vaguely useful on the web back in 2002 (see: python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange).

2005-12-4

Wordpress Plugins - writing extra elements into RSS feeds

Just trying to get a Wordpress plugin to add extra elements into an RSS feed, and I see that there isn't a proper API hook for this. It would be cool if an action (something like "write_extra_rss_elements") were called at the end of the <item> block. (Is there a plugin API wishlist somewhere?)

For the moment, I see that you can add extra XML into <item> by misusing the the_category_rss filter:

function add_rss_feed_elements($content)
{
   echo "<Look_at_me__I_can_add_elements_to_the_feed__Woohoo__/>\n";
   return $content;
}
add_filter("the_category_rss", 'add_rss_feed_elements');

You can probably do it in a slightly less hacky way by just appending the extra XML to $content, but I haven't tested this yet...

... more like this: [] ... topic exchange: [, ]