Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#46984 closed enhancement (duplicate)

Theme Modification API - set_theme_mod for multiple items at once

Reported by: andreadragotta's profile andreadragotta Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:


Using the Theme Modification API, when there is the need to update multiple theme modifications at the same time, the only way right now is to use the "set_theme_mod" function for each modification. In some situation this could cause a big impact on the DB. In our case, the whole server crashed because of this (the theme we used had many mods and it tried to update all of them).

It would be useful to have a function like "set_theme_mods" (plural) to set multiple mods while hitting the database only once. I already had to implement this in our website at theme-level, but I thought that it would be nice to have it in the API...

Does this looks good, or is there a better way?

Change History (1)

#1 @SergeyBiryukov
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @andreadragotta, welcome to WordPress Trac!

Thanks for the ticket, we're already tracking this enhancement in #20091.

Note: See TracTickets for help on using tickets.