Ticket #27534: 27534.2.diff
File 27534.2.diff, 2.1 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-customize-widgets.php
1317 1317 1318 1318 $this->_is_capturing_option_updates = true; 1319 1319 1320 add_filter( 'pre_update_option', array( $this, ' _capture_filter_pre_update_option' ), 10, 3 );1320 add_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 ); 1321 1321 } 1322 1322 1323 1323 /** … … 1331 1331 * @param mixed $old_value 1332 1332 * @return mixed 1333 1333 */ 1334 public function _capture_filter_pre_update_option( $new_value, $option_name, $old_value ) {1334 public function capture_filter_pre_update_option( $new_value, $option_name, $old_value ) { 1335 1335 if ( $this->is_option_capture_ignored( $option_name ) ) { 1336 1336 return; 1337 1337 } 1338 1338 1339 1339 if ( ! isset( $this->_captured_options[$option_name] ) ) { 1340 add_filter( "pre_option_{$option_name}", array( $this, ' _capture_filter_pre_get_option' ) );1340 add_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) ); 1341 1341 } 1342 1342 1343 1343 $this->_captured_options[$option_name] = $new_value; … … 1354 1354 * @param mixed $value Option 1355 1355 * @return mixed 1356 1356 */ 1357 public function _capture_filter_pre_get_option( $value ) {1357 public function capture_filter_pre_get_option( $value ) { 1358 1358 $option_name = preg_replace( '/^pre_option_/', '', current_filter() ); 1359 1359 1360 1360 if ( isset( $this->_captured_options[$option_name] ) ) { … … 1376 1376 return; 1377 1377 } 1378 1378 1379 remove_filter( '_capture_filter_pre_update_option', array( $this, '_capture_filter_pre_update_option' ), 10, 3 ); 1379 remove_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 ); 1380 1380 1381 foreach ( array_keys( $this->_captured_options ) as $option_name ) { 1381 remove_filter( "pre_option_{$option_name}", array( $this, ' _capture_filter_pre_get_option' ) );1382 remove_filter( "pre_option_{$option_name}", array( $this, 'capture_filter_pre_get_option' ) ); 1382 1383 } 1383 1384 1384 1385 $this->_captured_options = array();