WordPress.org

Make WordPress Core

Changes between Version 5 and Version 8 of Ticket #22252


Ignore:
Timestamp:
10/22/12 04:47:17 (18 months ago)
Author:
johnjamesjacoby
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22252

    • Property Milestone changed from Awaiting Review to 3.5
  • Ticket #22252 – Description

    v5 v8  
    3131* Improve search_theme_directories() to update 'stylesheet_root' and 'template_root' when 'theme_roots' transient doesn't match up. This works because we're already looping through the $cached_roots to make sure each theme is valid. The problem here is we're depending on the expiration of the transient, and doing additional logic each time that happens. (No patch attached) 
    3232---- 
    33 The crux of the issue: counting $wp_theme_directories isn't a reliable way to guarantee the current theme and its _root's match. This bug doesn't occur if more than 1 new theme directory is registered, because switch_theme() will always update the theme root in that circumstance. 
     33The crux of the issue: counting $wp_theme_directories isn't a reliable way to guarantee the current theme and its _root's match. This bug doesn't occur if more than 1 additional theme directory is registered, because switch_theme() will always update the theme root in that circumstance. 
    3434 
    3535By forcing switch_theme() to always save the roots, we're able to bypass the issue completely.  
    3636 
    37 Conversely, the only reason to store the _root's is when register_theme_directory() is used. If it's never used, it's never a problem. If it's always used, it's never a problem. It's only a problem when switching between it being used once, and then not at all. 
     37Conversely, the only reason to store the _root's is when register_theme_directory() is used more than once. If it's only used by core to register '/themes', it's never a problem. If it's always used by several plugins, it's never a problem. It's only a problem when switching between it being used more than once, and then only by core. 
    3838 
    3939This results in two additional options (even when there are never multiple theme roots) which sucks, but it always fixes the bug. 
    4040 
    41 If we fix it in search_theme_directories(), we're able to update the _root's when they need it, but we're performing that extra logic on each iteration when the transients expire. 
     41If we fix it in search_theme_directories(), we're able to update the _root's when they need it, but we're performing that extra logic on each iteration when the transients expire. Also, because search_theme_directories() has some funky sub-directory checks, it's a messy bit to try and hack in there.