[wp-hackers] Exporting blogroll to OPML

Ryan Boren ryan at boren.nu
Sat Dec 4 00:43:49 UTC 2004


On Fri, 2004-12-03 at 09:51 -0500, Kimmo Suominen wrote:
> I'll see if I could "pluginize" the whole thing today, to produce a page
> similar to what I have on my site.  I just haven't figured out how to
> hook into the mod_rewrite URL's through WP.  Any pointers, anyone?

I've been working on making this easier.  The rewrite functionality has
moved into a WP_Rewrite class which is globally instantiated as
$wp_rewrite.  Using some hooks I just committed, the attached plugin is
possible.  You can try it by going to /links/link-category-name/
or /index.php/links/link-category-name/.  Visit the Permalink options
page first to get the new rules into your .htaccess.  Of course, don't
do this on a production weblog.  Testbeds only.  This is very bleeding
edge.

Anyway, the plugin directs /links/... requests to wp-links-opml.php,
passing along a link category name.  wp-links-opml.php doesn't currently
do anything with the category name, so you're not going to get anything
useful.  But there is the *potential* for usefulness.  ;-)

Plugin attached.  I included some comments that attempt to provide some
explanation of what's going on.

Ryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link_opml.php
Type: application/x-php
Size: 2059 bytes
Desc: not available
Url : /pipermail/hackers_wordpress.org/attachments/20041203/269eb0d2/link_opml.bin


More information about the hackers mailing list