[wp-trac] [WordPress Trac] #12935: Evolve the URL routing system

WordPress Trac wp-trac at lists.automattic.com
Thu May 27 21:52:17 UTC 2010


#12935: Evolve the URL routing system
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |       Owner:  ryan
     Type:  enhancement   |      Status:  new 
 Priority:  normal        |   Milestone:  3.1 
Component:  Permalinks    |     Version:  3.0 
 Severity:  normal        |    Keywords:      
--------------------------+-------------------------------------------------

Comment(by scribu):

 > BTW, i'm not sharing the code for the WP_Routes class yet because I want
 to refactor is significant before I expose it to public scrutiny.

 Release early, release often. :)

 == Mapping routes to query_vars ==

 > Yes, I agree that specifying the callback as part of the Routes might be
 preferable if we didn't have existing themes and plugins that expect the
 query system to work as is but I think this is the best approach
 considering where we are right now.

 Agreed.


 == Optional path segments ==

 > One thing I have yet to figure out is how best to specify optional path
 segments. I'm loath to introduce new special characters to the URL
 template but I am considering using square brackets like so and would like
 to get other's input on this?

 >
 {{{register_route_path('%pagename%/[%%trackback_feed_page_paged_comment_page%%]');}}}

 That's an acceptable notation, except it gets confusing if you want to
 specify multiple optional segments:

 {{{register_route_path('%a%/[%b%]/[%c%]');}}}

 {{{register_route_path('%a%/[%b%][/%c%]');}}}

 {{{register_route_path('%a%/[%b%/][%c%]');}}}

 Since we're not inspecting full paths anymore, maybe we could register an
 array instead of a string:

 {{{register_route_path(array('%a%', array('%b%', %c%)));}}}

 The first level elements are mandatory, while the second level elements
 are optional.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12935#comment:30>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list