Make WordPress Core

Ticket #33499: 33499.2.diff

File 33499.2.diff, 1.2 KB (added by westonruter, 9 years ago)

Alternate approach

  • src/wp-includes/class-wp-customize-setting.php

    diff --git src/wp-includes/class-wp-customize-setting.php src/wp-includes/class-wp-customize-setting.php
    index d007965..c54a3b3 100644
    class WP_Customize_Setting { 
    3636        public $type = 'theme_mod';
    3737
    3838        /**
     39         * When the type is option, this is passed in to the $autoload argument for update_option().
     40         *
     41         * @access public
     42         * @var bool
     43         */
     44        public $autoload = true;
     45
     46        /**
    3947         * Capability required to edit this setting.
    4048         *
    4149         * @var string
    class WP_Customize_Setting { 
    357365        protected function _update_option( $value ) {
    358366                // Handle non-array option.
    359367                if ( empty( $this->id_data[ 'keys' ] ) )
    360                         return update_option( $this->id_data[ 'base' ], $value );
     368                        return update_option( $this->id_data[ 'base' ], $value, $this->autoload );
    361369
    362370                // Handle array-based options.
    363371                $options = get_option( $this->id_data[ 'base' ] );
    364372                $options = $this->multidimensional_replace( $options, $this->id_data[ 'keys' ], $value );
    365373                if ( isset( $options ) )
    366                         return update_option( $this->id_data[ 'base' ], $options );
     374                        return update_option( $this->id_data[ 'base' ], $options, $this->autoload );
    367375        }
    368376
    369377        /**