Changeset 26304 for trunk/src/wp-includes/option.php
- Timestamp:
- 11/21/2013 07:06:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/option.php
r25925 r26304 758 758 759 759 // prevent non-existent options from triggering multiple queries 760 $notoptions = wp_cache_get( 'notoptions', 'site-options' ); 760 $notoptions_key = "{$wpdb->siteid}:notoptions"; 761 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 761 762 if ( isset( $notoptions[$option] ) ) 762 763 return apply_filters( 'default_site_option_' . $option, $default ); … … 780 781 } else { 781 782 $notoptions[$option] = true; 782 wp_cache_set( 'notoptions', $notoptions, 'site-options' );783 wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); 783 784 $value = apply_filters( 'default_site_option_' . $option, $default ); 784 785 } … … 813 814 814 815 $value = apply_filters( 'pre_add_site_option_' . $option, $value ); 816 $notoptions_key = "{$wpdb->siteid}:notoptions"; 815 817 816 818 if ( !is_multisite() ) { … … 820 822 821 823 // Make sure the option doesn't already exist. We can check the 'notoptions' cache before we ask for a db query 822 $notoptions = wp_cache_get( 'notoptions', 'site-options' );824 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 823 825 if ( ! is_array( $notoptions ) || ! isset( $notoptions[$option] ) ) 824 826 if ( false !== get_site_option( $option ) ) … … 836 838 837 839 // This option exists now 838 $notoptions = wp_cache_get( 'notoptions', 'site-options' ); // yes, again... we need it to be fresh840 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); // yes, again... we need it to be fresh 839 841 if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) { 840 842 unset( $notoptions[$option] ); 841 wp_cache_set( 'notoptions', $notoptions, 'site-options' );843 wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); 842 844 } 843 845 } … … 923 925 return add_site_option( $option, $value ); 924 926 925 $notoptions = wp_cache_get( 'notoptions', 'site-options' ); 927 $notoptions_key = "{$wpdb->siteid}:notoptions"; 928 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 926 929 if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) { 927 930 unset( $notoptions[$option] ); 928 wp_cache_set( 'notoptions', $notoptions, 'site-options' );931 wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); 929 932 } 930 933
Note: See TracChangeset
for help on using the changeset viewer.