- Timestamp:
- 02/11/2015 06:24:01 AM (10 years ago)
- Location:
- branches/4.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1
- Property svn:mergeinfo changed
/trunk merged: 31329,31339,31342,31360
- Property svn:mergeinfo changed
-
branches/4.1/src/wp-includes/class-wp-customize-setting.php
r30676 r31410 104 104 } 105 105 106 protected $_original_value; 107 106 108 /** 107 109 * Handle previewing the setting. … … 110 112 */ 111 113 public function preview() { 114 if ( ! isset( $this->_original_value ) ) { 115 $this->_original_value = $this->value(); 116 } 117 112 118 switch( $this->type ) { 113 119 case 'theme_mod' : … … 160 166 */ 161 167 public function _preview_filter( $original ) { 162 return $this->multidimensional_replace( $original, $this->id_data[ 'keys' ], $this->post_value() ); 168 $undefined = new stdClass(); // symbol hack 169 $post_value = $this->manager->post_value( $this, $undefined ); 170 if ( $undefined === $post_value ) { 171 $value = $this->_original_value; 172 } else { 173 $value = $post_value; 174 } 175 176 return $this->multidimensional_replace( $original, $this->id_data['keys'], $value ); 163 177 } 164 178 … … 426 440 } 427 441 428 if ( $create && ! isset( $node[ $last ] ) ) 429 $node[ $last ] = array(); 442 if ( $create ) { 443 if ( ! is_array( $node ) ) { 444 // account for an array overriding a string or object value 445 $node = array(); 446 } 447 if ( ! isset( $node[ $last ] ) ) { 448 $node[ $last ] = array(); 449 } 450 } 430 451 431 452 if ( ! isset( $node[ $last ] ) )
Note: See TracChangeset
for help on using the changeset viewer.