#33628 closed enhancement (maybelater)
Improve caching on get_theme_mods function
| Reported by: | spacedmonkey | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Themes | Version: | 3.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | performance |
Description
Currently whenever the get_theme_mods function is called, it calls the also the get_options function twice. This means that whenever the get_theme_mod / set_theme_mod / remove_theme_mod , also makes a call to options table. This value is not cached in memory, so whenever get_theme_mod is called it will get the values from the db / object cache.
To improve performance, after the first time the function is called, theme mods should be stored as a global / static variable.
Attachments (2)
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)