Changeset 12973 for trunk/wp-includes/functions.php
- Timestamp:
- 02/05/2010 05:59:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r12961 r12973 336 336 } 337 337 338 $alloptions = wp_load_alloptions(); 338 if ( ! defined( 'WP_INSTALLING' ) ) { 339 $alloptions = wp_load_alloptions(); 340 } 339 341 340 342 if ( isset( $alloptions[$setting] ) ) { … … 496 498 497 499 do_action( 'update_option', $option_name, $oldvalue, $newvalue ); 498 $alloptions = wp_load_alloptions(); 499 if ( isset( $alloptions[$option_name] ) ) { 500 $alloptions[$option_name] = $newvalue; 501 wp_cache_set( 'alloptions', $alloptions, 'options' ); 502 } else { 503 wp_cache_set( $option_name, $newvalue, 'options' ); 500 if ( ! defined( 'WP_INSTALLING' ) ) { 501 $alloptions = wp_load_alloptions(); 502 if ( isset( $alloptions[$option_name] ) ) { 503 $alloptions[$option_name] = $newvalue; 504 wp_cache_set( 'alloptions', $alloptions, 'options' ); 505 } else { 506 wp_cache_set( $option_name, $newvalue, 'options' ); 507 } 504 508 } 505 509 … … 561 565 $autoload = ( 'no' === $autoload ) ? 'no' : 'yes'; 562 566 do_action( 'add_option', $name, $value ); 563 if ( 'yes' == $autoload ) { 564 $alloptions = wp_load_alloptions(); 565 $alloptions[$name] = $value; 566 wp_cache_set( 'alloptions', $alloptions, 'options' ); 567 } else { 568 wp_cache_set( $name, $value, 'options' ); 567 if ( ! defined( 'WP_INSTALLING' ) ) { 568 if ( 'yes' == $autoload ) { 569 $alloptions = wp_load_alloptions(); 570 $alloptions[$name] = $value; 571 wp_cache_set( 'alloptions', $alloptions, 'options' ); 572 } else { 573 wp_cache_set( $name, $value, 'options' ); 574 } 569 575 } 570 576 … … 607 613 // expected_slashed ($name) 608 614 $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name = '$name'" ); 609 if ( 'yes' == $option->autoload ) { 610 $alloptions = wp_load_alloptions(); 611 if ( isset( $alloptions[$name] ) ) { 612 unset( $alloptions[$name] ); 613 wp_cache_set( 'alloptions', $alloptions, 'options' ); 615 if ( ! defined( 'WP_INSTALLING' ) ) { 616 if ( 'yes' == $option->autoload ) { 617 $alloptions = wp_load_alloptions(); 618 if ( isset( $alloptions[$name] ) ) { 619 unset( $alloptions[$name] ); 620 wp_cache_set( 'alloptions', $alloptions, 'options' ); 621 } 622 } else { 623 wp_cache_delete( $name, 'options' ); 614 624 } 615 } else {616 wp_cache_delete( $name, 'options' );617 625 } 618 626 do_action( 'deleted_option', $name ); … … 666 674 $value = wp_cache_get($transient, 'transient'); 667 675 } else { 668 $transient_option = '_transient_' . esc_sql($transient); 669 // If option is not in alloptions, it is not autoloaded and thus has a timeout 670 $alloptions = wp_load_alloptions(); 671 if ( !isset( $alloptions[$transient_option] ) ) { 672 $transient_timeout = '_transient_timeout_' . esc_sql($transient); 673 if ( get_option($transient_timeout) < time() ) { 674 delete_option($transient_option); 675 delete_option($transient_timeout); 676 return false; 676 if ( ! defined( 'WP_INSTALLING' ) ) { 677 $transient_option = '_transient_' . esc_sql($transient); 678 // If option is not in alloptions, it is not autoloaded and thus has a timeout 679 $alloptions = wp_load_alloptions(); 680 if ( !isset( $alloptions[$transient_option] ) ) { 681 $transient_timeout = '_transient_timeout_' . esc_sql($transient); 682 if ( get_option($transient_timeout) < time() ) { 683 delete_option($transient_option); 684 delete_option($transient_timeout); 685 return false; 686 } 677 687 } 678 688 } … … 1743 1753 1744 1754 $suppress = $wpdb->suppress_errors(); 1745 $alloptions = wp_load_alloptions(); 1755 if ( ! defined( 'WP_INSTALLING' ) ) { 1756 $alloptions = wp_load_alloptions(); 1757 } 1746 1758 // If siteurl is not set to autoload, check it specifically 1747 1759 if ( !isset( $alloptions['siteurl'] ) )
Note: See TracChangeset
for help on using the changeset viewer.