[wp-trac] [WordPress Trac] #22252: register_theme_directory() usage can break the current theme
WordPress Trac
noreply at wordpress.org
Sun Nov 11 21:50:42 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):
validate_current_theme() calls switch_theme() to the default theme when it
finds that the theme is invalid. This is why on step 4 (in the original
report description), the theme is back to Twenty Twelve.
The problem is that by this point, only one theme root exists, so
template_root and stylesheet_root are left untouched. Deleting them here
would fix most of these issues.
The remaining issue is that validate_current_theme() should actually
validate that any stored theme roots are accurate, to catch potential edge
cases. (Such as when the same bp-default theme is in both roots, then one
of the roots disappears.) I'd like to try doing that without causing non-
existent option calls on single-site, though. Basically:
* If there's one theme root, it should delete any _root options.
* If there's more than one theme root, it should make sure any _root
options are accurate (similar to your code in switch_theme() in 2.patch).
For 3.5, [attachment:22252.diff] seems sufficient.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22252#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list