﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
9460,Add custom_url_func to be run in template-loader.php,mikeschinkel,mikeschinkel,"This is a follow-on from Ticket #9455 where the #9455 attempted to resolve one issue using a shortcut but the shortcut turned out to cause undesirable side effects and also did not address the fact that 404 and noncache headers had already been set.

So this ticket provides a patch that will allow for a custom_url_func to be called at the beginning of template-loader.php. The custom_url_func can be set in a 'parse_query' hook using code that looks like this for the URL ""/foobar/"":


{{{

   add_action('parse_query','my_parse_query');
   function my_parse_query() {
      if ($_SERVER['REQUEST_URI']=='/foobar/')
        set_custom_url_func('my_foobar_func');
   }
   function my_foobar_func() {
      echo 'Hello FooBar!  Bye.';
   }

}}}


Granted, this might not be the best way to accomplish this. For example, using a new filter might be a better way to accomplish this but I was trying not to add additional filter processing overhead assuming that might be a concern. I'm not attached to this particular solution, I just want to be able to get proper control of custom URLs that don't fit any of the existing patterns that have been baked into WordPress core and ideally I don't want it to have to be uber-complex for the plugin or theme developer either.
",enhancement,new,normal,Future Release,Permalinks,2.8,normal,,needs-patch custom url,westi ryan GamerZ
