[wp-hackers] Filter Hooks for Enclosures

Peter Westwood peter.westwood at ftwr.co.uk
Mon Feb 13 21:24:29 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Owen Winkler wrote:
> 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.
> 

Why not just makes feeds template items so that a user theme can have an
 rss template for example rss.php, atom.php etc. and this is used
instead of the builtin feed handler.

If we standardise on hooks for the main places a plugin would want to
add and let the enduser extend some more if necessary.

This allows people to customise feeds to any degree without having to
muck around with object buffers and building/throwing away huge object
structures for every feed request.

westi
- --
Peter Westwood
http://blog.ftwr.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD8PkNVPRdzag0AcURAq/UAJ4xRqnBytO6z+YlnX9qzqdyygw3TQCgo8ZF
VRoL1Z3ozz3u7U7ju7kbJuk=
=C/Ve
-----END PGP SIGNATURE-----



More information about the wp-hackers mailing list