[wp-trac] [WordPress Trac] #25671: get_theme_mods does not have a filter

WordPress Trac noreply at wordpress.org
Sun Sep 13 10:43:22 UTC 2015


#25671: get_theme_mods does not have a filter
-----------------------------------------+------------------------------
 Reporter:  scottsweb                    |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Themes                       |     Version:
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+------------------------------

Comment (by markkaplun):

 Replying to [comment:9 spacedmonkey]:
 > There should also be a pre filter at the top of the function. At the
 moment, the get_theme_mods function is not cached at all. Something I have
 mentioned in #33628 . It makes two calls to get_options, every time the
 function is call, which is ALOT.

 Unless misused, get_option is a very efficient function that reads a value
 from the memory and attempting to avoid a call to it will bring a very
 minute gain in performance, probably something you will find hard to
 measure at all.

 In case you misunderstand how the options API work - on boot all options
 are read from the DB in one SQL query and then stored in the memory. any
 get_option will check first the memory and only if the option is not
 already in the memory it will issue a request to the DB. The exception are
 non autoloading options, but in proper use there should not be any non
 autoloading option used on the front end.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25671#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list