Ticket #5346 (closed defect (bug): fixed)
Cache current theme in options
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.5 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | performances themes |
| 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
Change History
Note: See
TracTickets for help on using
tickets.


Adds switch_theme() and caches current theme in options