Opened 16 years ago
Closed 16 years ago
#5346 closed defect (bug) (fixed)
Cache current theme in options
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | performances themes |
Focuses: | Cc: |
Description
get_theme_mod() calls get_current_theme() which in turn calls get_themes(). get_themes() scans and parses all themes. This means that themes that call get_theme_mod() scan and parse all themes on every page load. This includes themes that use the custom image header library. Profiling on my testbed revealed that 10% of the load time for the front page was due to get_theme_mod() and friends. Saving the current theme in options eliminates the need to rescan themes on every load.
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Adds switch_theme() and caches current theme in options