[wp-hackers] Filter Hooks for Enclosures

Owen Winkler ringmaster at midnightcircus.com
Mon Feb 13 16:58:32 GMT 2006


Denis de Bernardy wrote:
>> There are some extant implementations of Object<->XML in PHP, so it 
>> might not be too difficult a conversion.  Manipulating the 
>> feed XML via 
>> DOM in a plugin would be swell.
>>
>> Before I continue blathering about this, how much does this idea suck?
> 
> DOM/XML related stuff is far from being installed properly on most hosts,
> and does not work the same in php4 and php5. I'd use a straightforward array
> instead.

That's really more what I was suggesting.

There must be some class that would let us do something like this:

ob_start();
// Existing feed stuff
$xml = ob_get_clean();
$feed = new WPXmlDoc($xml);
$feed = apply_filters('feed_xml', $feed);
$feed->output();

...

add_filter('feed_xml', 'my_feed_xml');
function my_feed_xml($feed)
{
	$feed->data['rss'][0]['customtag'][0] = 'test';
	return $feed;
}

Or something.

Owen



More information about the wp-hackers mailing list