Ticket #21989: no-double-handling.patch
File no-double-handling.patch, 1.0 KB (added by , 19 months ago) |
---|
-
wp-includes/option.php
a b 461 461 $value = clone $value; 462 462 } 463 463 464 $value = sanitize_option( $option, $value );465 464 $old_value = get_option( $option ); 466 465 466 $notoptions = wp_cache_get( 'notoptions', 'options' ); 467 468 if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { 469 // Default setting for new options is 'yes'. 470 if ( null === $autoload ) { 471 $autoload = 'yes'; 472 } 473 474 return add_option( $option, $value, '', $autoload ); 475 } 476 477 $value = sanitize_option( $option, $value ); 478 467 479 /** 468 480 * Filters a specific option before its value is (maybe) serialized and updated. 469 481 * … … 502 513 return false; 503 514 } 504 515 505 /** This filter is documented in wp-includes/option.php */506 if ( apply_filters( "default_option_{$option}", false, $option, false ) === $old_value ) {507 // Default setting for new options is 'yes'.508 if ( null === $autoload ) {509 $autoload = 'yes';510 }511 512 return add_option( $option, $value, '', $autoload );513 }514 515 516 $serialized_value = maybe_serialize( $value ); 516 517 517 518 /**