[wp-trac] Re: [WordPress Trac] #9460: Add custom_url_func to be run in template-loader.php

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 5 01:34:45 GMT 2009


#9460: Add custom_url_func to be run in template-loader.php
--------------------------+-------------------------------------------------
 Reporter:  mikeschinkel  |       Owner:  mikeschinkel
     Type:  enhancement   |      Status:  new         
 Priority:  normal        |   Milestone:  Unassigned  
Component:  Permalinks    |     Version:  2.8         
 Severity:  normal        |    Keywords:  custom url  
--------------------------+-------------------------------------------------

Comment(by DD32):

 > So I guess the question is, what's the downside of implementing
 (something like) the "escape valve" shown?

 Other than that from a code POV it looks plain ugly and a half-baked
 solution? - Honestly, Looking at it you've got absolutely no chance in
 hell of anything like that being committed. (from a non-commiters POV
 here)

 Ideally, Someone who understands WP_Rewrite enough & Templates enough
 needs to attempt to make a simple API which does what you need, so that
 plugins which utilise it would be also able to work without the rewrite
 module (ie. ?artist=test-artist as well as /artist/test-artist/)

 The problem that i keep hitting every time i try and write a piece of
 example code here, Is that Themers -Need- to know how to program PHP, They
 need to know how to program with WordPress, There shouldnt be a "But they
 shouldnt need to" arguement there, If they want to program, they need to
 learn how to. [[BR]]
 Its incredibly hard to offer advanced-level functionality to basic-level
 programmers in a way that they'll understand.


 {{{
 add_startpoint(
    'artist/%artist_slug%/%artist_song%/',
    array(
       'vars' => array(
           'artist_slug' => array(
               'required' => false,
               'callback' => ....
            )
            'artist_song' => array(....)
       ),
       'callback' => .....,
    )
 );
 }}}

 thats just a simple version.. Its not exactly looking easy to understand
 for a new user.. Nor would it technically be easy to create a rule based
 off that, Look at the ammount of code which converts the Permalink
 Structure to rules..

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


More information about the wp-trac mailing list