[wp-hackers] Permalinkg Rule

Mike Schinkel mikeschinkel at newclarity.net
Mon Jun 7 14:16:00 UTC 2010


Hi Dion:

> ..And now for a "proper" implementation of it... Mike, I dont get whats so hard..

It may be "proper", but in no way do I see it as "less hard."  The (current) "proper" approach is fraught with complexity. The global nature of the regex's use have significant potential for side effects and must be handled in a plugin vs. a theme in order to support activation (i.e. flushing rules.)

> Perhaps you need to start off basic, and work your way up, instead of writing a parser from scratch..

I've written a lot of rewrite code for WordPress. I've run into lots of trouble with it (it's probably the most "fragile" component of WordPress that I've touched.)  And unlike the rest of WordPress, rewriting never really gets easier (at least not for me.)

> For the sake of people who wont follow links, here's the guts of that plugin, without comments, to show the difference to Mikes suggestion:

I'm very much for following best practices but in this case I seriously question if the standard approach to rewrites really are "best."  But then you probably also know I have a trac ticket open to evolve the URL rewrite system[1] that I have been working on as I have had the time.

-Mike
[1] http://core.trac.wordpress.org/ticket/12935



More information about the wp-hackers mailing list