[wp-trac] [WordPress Trac] #10160: Load template/stylesheet functions later after init

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 14 18:06:37 GMT 2009


#10160: Load template/stylesheet functions later after init
--------------------------+-------------------------------------------------
 Reporter:  casualgenius  |       Owner:            
     Type:  enhancement   |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Themes        |     Version:            
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 I write a plugin that lets site owners have different categories served up
 as subdomains. One of the main features is you can pick different themes
 for the different subdomain categories. This all worked fairly well until
 wordpress 2.8 was released.

 My plugin uses get_categories to find a list of all categories. In 2.8 you
 moved the creation of default taxonomies into a function
 (create_initial_taxonomies) that is run by the "init" action hook. However
 my plugin needs to use the get_categories function before init.

 I know it's been said that plugins shouldn't actually do anything before
 init (as mentioned here #9647). However, the Template and Stylesheet
 functions are loaded before init. Therefore I have to do something with
 the categories prior to init because I need to have filters for
 "pre_option_template" and "pre_option_stylesheet" ready to supply the new
 template/stylesheet path should it need to.

 I know I could just write some custom SQL to get the data I need and
 discard get_categories. I've already had to do this for fetching the list
 of authors on the site (plugin supports subdomain by author too). But
 really I'd rather use the available wordpress API.

 I'm sorry if this has been a very long winded way of reaching my question,
 which is:

 Can the define of the TEMPLATEPATH and STYLESHEETPATH and subsequent
 loading of theme functions (should they exist) be done after init rather
 than before?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10160>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list