[wp-trac] [WordPress Trac] #22252: register_theme_directory() usage can break the current theme

WordPress Trac noreply at wordpress.org
Sun Nov 11 21:25:34 UTC 2012


#22252: register_theme_directory() usage can break the current theme
-----------------------------+--------------------
 Reporter:  johnjamesjacoby  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  3.5
Component:  Themes           |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |
-----------------------------+--------------------

Comment (by nacin):

 I don't see what [attachment:22252.2.patch] does. `get_raw_theme_root(
 $stylesheet_or_template, true )` directly consults the theme_roots
 transient just the same. What am I missing?

 `/themes` isn't a useless database entry, as if more than one theme root
 is registered, we're going to consult the root options either way. If the
 option doesn't exist, then we end up with a call to the DB to fetch a
 nonexistent option. Much cheaper to store an autoloaded option. We avoid
 storing the root options when only one theme directory is registered,
 which is sufficient.

 A unit test would help. I'm going to keep looking into this.

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


More information about the wp-trac mailing list