Ticket #21989: no-double-handling-2.patch
File no-double-handling-2.patch, 1.2 KB (added by , 17 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 /** This filter is documented in wp-includes/option.php */ 470 if ( apply_filters( "default_option_{$option}", false, $option, false ) === $old_value ) { 471 // Default setting for new options is 'yes'. 472 if ( null === $autoload ) { 473 $autoload = 'yes'; 474 } 475 476 return add_option( $option, $value, '', $autoload ); 477 } 478 479 return false; 480 } 481 482 $value = sanitize_option( $option, $value ); 483 467 484 /** 468 485 * Filters a specific option before its value is (maybe) serialized and updated. 469 486 * … … 502 519 return false; 503 520 } 504 521 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 522 $serialized_value = maybe_serialize( $value ); 516 523 517 524 /**