[wp-trac] [WordPress Trac] #53807: Add function or filter to send all customizer setting default values to the database upon theme installation

WordPress Trac noreply at wordpress.org
Wed Jul 28 00:38:08 UTC 2021


#53807: Add function or filter to send all customizer setting default values to the
database upon theme installation
-----------------------------+------------------------------
 Reporter:  curtiskessler    |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Customize        |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by curtiskessler):

 My new theme has 100+ customizer settings, most of which have a default
 value which is intended to be displayed in both the customizer view and
 the front end when the theme is installed.

 Is there any way to do this without having to define the same default
 value in the add_setting() array and in every instance of get_theme_mod()
 that uses the setting in my theme files?

 This is my complaint: duplication of these values is very tedious, from a
 development standpoint.

 It would be great if I could define them once and have them appear both on
 the front end and the customizer view, upon theme installation.

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


More information about the wp-trac mailing list