[wp-trac] [WordPress Trac] #33499: Allow `$autoload` to be set in `WP_Customize_Setting::_update_option()`

WordPress Trac noreply at wordpress.org
Sat Oct 17 06:59:27 UTC 2015


#33499: Allow `$autoload` to be set in `WP_Customize_Setting::_update_option()`
-------------------------+--------------------------
 Reporter:  dlh          |       Owner:  westonruter
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  4.4
Component:  Customize    |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+--------------------------

Comment (by westonruter):

 [attachment:33499.3.diff] makes use of the multidimensional-aggregate
 static array to store the `autoload` flag. So if you wanted to add a non-
 autoloaded option you can still do this:

 {{{#!php
 <?php
 $wp_customize->add_setting( 'foo[first]', array(
     'type' => 'option',
     'autoload' => false,
 ) );
 }}}

 However, there would not be an `$setting->autoload` property to read back
 the value from. I also didn't think it would be good to add a class member
 variable to the base `WP_Customize_Setting` class since it is inherited by
 all other settings, and it wouldn't make sense for them all to have an
 unused `$autoload` property.

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


More information about the wp-trac mailing list