Ticket #21989: 21989.diff
File 21989.diff, 1.3 KB (added by , 10 years ago) |
---|
-
src/wp-includes/option.php
240 240 if ( is_object( $value ) ) 241 241 $value = clone $value; 242 242 243 $value = sanitize_option( $option, $value );244 243 $old_value = get_option( $option ); 244 if ( false === $old_value ) 245 return add_option( $option, $value ); 245 246 247 $value = sanitize_option( $option, $value ); 248 246 249 /** 247 250 * Filter a specific option before its value is (maybe) serialized and updated. 248 251 * … … 270 273 if ( $value === $old_value ) 271 274 return false; 272 275 273 if ( false === $old_value )274 return add_option( $option, $value );275 276 276 $serialized_value = maybe_serialize( $value ); 277 277 278 278 /** … … 1166 1166 wp_protect_special_option( $option ); 1167 1167 1168 1168 $old_value = get_site_option( $option ); 1169 if ( false === $old_value ) 1170 return add_site_option( $option, $value ); 1169 1171 1170 1172 /** 1171 1173 * Filter a specific site option before its value is updated. … … 1183 1185 if ( $value === $old_value ) 1184 1186 return false; 1185 1187 1186 if ( false === $old_value )1187 return add_site_option( $option, $value );1188 1189 1188 $notoptions_key = "{$wpdb->siteid}:notoptions"; 1190 1189 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 1191 1190 if ( is_array( $notoptions ) && isset( $notoptions[$option] ) ) {