Changeset 31329 for trunk/src/wp-includes/class-wp-customize-setting.php
- Timestamp:
- 02/03/2015 10:14:28 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-setting.php
r31126 r31329 101 101 } 102 102 103 protected $_original_value; 104 103 105 /** 104 106 * Handle previewing the setting. … … 107 109 */ 108 110 public function preview() { 111 if ( ! isset( $this->_original_value ) ) { 112 $this->_original_value = $this->value(); 113 } 114 109 115 switch( $this->type ) { 110 116 case 'theme_mod' : … … 157 163 */ 158 164 public function _preview_filter( $original ) { 159 return $this->multidimensional_replace( $original, $this->id_data[ 'keys' ], $this->post_value() ); 165 $undefined = new stdClass(); // symbol hack 166 $post_value = $this->manager->post_value( $this, $undefined ); 167 if ( $undefined === $post_value ) { 168 $value = $this->_original_value; 169 } else { 170 $value = $post_value; 171 } 172 173 return $this->multidimensional_replace( $original, $this->id_data['keys'], $value ); 160 174 } 161 175 … … 423 437 } 424 438 425 if ( $create && ! isset( $node[ $last ] ) ) 426 $node[ $last ] = array(); 439 if ( $create ) { 440 if ( ! is_array( $node ) ) { 441 // account for an array overriding a string or object value 442 $node = array(); 443 } 444 if ( ! isset( $node[ $last ] ) ) { 445 $node[ $last ] = array(); 446 } 447 } 427 448 428 449 if ( ! isset( $node[ $last ] ) )
Note: See TracChangeset
for help on using the changeset viewer.