[wp-trac] [WordPress Trac] #17597: register theme directory() not working for themes outside WP_CONTENT_DIR

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 28 01:24:45 UTC 2012


#17597: register theme directory() not working for themes outside WP_CONTENT_DIR
--------------------------+--------------------
 Reporter:  tliebig       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.4
Component:  Themes        |     Version:  3.1.3
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by nacin):

 [attachment:get_raw_theme_root.diff] should fix this.

 This changes the return value of get_raw_theme_root() in some cases., for
 it to always be absolute. I am not concerned. One, there are no plugins
 using get_raw_theme_root() in the directory. Two, it is such an edge
 function, that if you were using it, you were surely playing with multiple
 theme roots, and therefore would have noticed the discrepancy in the
 return value such that you worked around it, perhaps by looking for
 '/themes' and prepending WP_CONTENT_DIR.

 This also fixes the return value of get_theme_roots() by making it
 absolute when only one directory is registered. I am not concerned for the
 same reason as above. It also now returns in this case get_theme_root(),
 rather than WP_CONTENT_DIR . /themes, because get_theme_root() is a
 filtered version of that, and that is what we pass to
 register_theme_directory() to register the initial theme root. However,
 WP_CONTENT_DIR . '/themes' is still used in get_raw_theme_root() as that
 is designed to be raw and unfiltered.

 The code for grabbing a theme root URI is still lame (it strips out
 WP_CONTENT_DIR then passes it to content_url()), but this is no less lame
 than it is in get_themes() or even WP_Theme.

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


More information about the wp-trac mailing list