Make WordPress Core

Ticket #33499: 33499.3.diff

File 33499.3.diff, 1.2 KB (added by westonruter, 8 years ago)
  • 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 01b84c8..800dfab 100644
    class WP_Customize_Setting { 
    144144                        // Other setting types can opt-in to aggregate multidimensional explicitly.
    145145                        $this->aggregate_multidimensional();
    146146                }
     147
     148                // Allow option settings to indicate whether they should be autoloaded.
     149                if ( 'option' === $this->type ) {
     150                        $autoload = true;
     151                        if ( isset( $args['autoload'] ) ) {
     152                                $autoload = $args['autoload'];
     153                        }
     154                        // @todo issue warning if already set and not equal to $autoload?
     155                        self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'] = $autoload;
     156                }
    147157        }
    148158
    149159        /**
    class WP_Customize_Setting { 
    502512        protected function set_root_value( $value ) {
    503513                $id_base = $this->id_data['base'];
    504514                if ( 'option' === $this->type ) {
    505                         return update_option( $id_base, $value );
     515                        return update_option( $id_base, $value, self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'] );
    506516                } else if ( 'theme_mod' ) {
    507517                        set_theme_mod( $id_base, $value );
    508518                        return true;