[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 15:16:34 UTC 2012


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

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 I made this worse with [20001].

 Due to work in #20103 and due to my familiarity with the return value of
 search_theme_directories(), I missed that the theme_roots transient was
 actually relative to WP_CONTENT_DIR. Therefore it is not only possible for
 one to have a relative path in their template_root and stylesheet_root
 (which I did not think was possible), but it is the only situation.

 Paths relative to WP_CONTENT_DIR are going to be much nicer to work with,
 and they are portable. But we still need absolute paths somewhere.

 I am trying to come up with a solution here, but I am not sure what it
 will be yet. One option is that we try to store a relative path (strip out
 WP_CONTENT_DIR if we find it), and then when we pull that data, if the
 path is not in $wp_theme_directories, but WP_CONTENT_DIR + path is, it's
 pretty easy to assume it is relative.

 This keeps the database relatively clear, the theme_roots transient free
 of repetitive absolute paths (much less data being stored), and doesn't
 hurt #20103 too much.

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


More information about the wp-trac mailing list