WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 15 months ago

#33600 new enhancement

Add `theme_mods_{$stylesheet}` option during `populate_options()`

Reported by: dlh Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch has-unit-tests needs-testing
Focuses: Cc:

Description

After switch_theme(), a theme_mods_{$stylesheet} option is created if one doesn't exist to avoid extra database queries (if I understand #14828 correctly).

No similar option is currently created during installation, so a fresh install can includes those queries if the default theme looks for the mods before the option is added.

The attached patch would add the option during populate_options().

I included a unit test, although I'm not sure where the best location for it would be.

Attachments (1)

33600.patch (1.1 KB) - added by dlh 4 years ago.

Download all attachments as: .zip

Change History (4)

@dlh
4 years ago

#1 @swissspidy
2 years ago

  • Keywords has-patch has-unit-tests needs-testing added
  • Milestone changed from Awaiting Review to Future Release

This ticket was mentioned in Slack in #themereview by joyously. View the logs.


15 months ago

#3 @joyously
15 months ago

Hmm, my theme actually uses the fact that it is not populated to supply default values and know that it is brand new.

Note: See TracTickets for help on using tickets.