Make WordPress Core


Ignore:
Timestamp:
01/11/2010 09:49:40 PM (14 years ago)
Author:
wpmuguru
Message:

merge in multisite login, wp-includes, See #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r12686 r12697  
    328328
    329329    // prevent non-existent options from triggering multiple queries
    330     $notoptions = wp_cache_get( 'notoptions', 'options' );
    331     if ( isset( $notoptions[$setting] ) )
    332         return $default;
     330    if ( defined( 'WP_INSTALLING' ) && is_multisite() ) {
     331        $notoptions = array();
     332        } else {
     333                $notoptions = wp_cache_get( 'notoptions', 'options' );
     334                if ( isset( $notoptions[$setting] ) )
     335                        return $default;
     336        }
    333337
    334338    $alloptions = wp_load_alloptions();
     
    412416    global $wpdb;
    413417
    414     $alloptions = wp_cache_get( 'alloptions', 'options' );
     418    if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
     419            $alloptions = wp_cache_get( 'alloptions', 'options' );
    415420
    416421    if ( !$alloptions ) {
     
    422427        foreach ( (array) $alloptions_db as $o )
    423428            $alloptions[$o->option_name] = $o->option_value;
    424         wp_cache_add( 'alloptions', $alloptions, 'options' );
     429                if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
     430                        wp_cache_add( 'alloptions', $alloptions, 'options' );
    425431    }
    426432    return $alloptions;
     
    624630    global $_wp_using_ext_object_cache, $wpdb;
    625631
     632        if( is_multisite() )
     633                do_action( 'delete_transient_' . $transient );
     634
    626635    if ( $_wp_using_ext_object_cache ) {
    627636        return wp_cache_delete($transient, 'transient');
     
    690699function set_transient($transient, $value, $expiration = 0) {
    691700    global $_wp_using_ext_object_cache, $wpdb;
     701
     702        if( is_multisite() )
     703                $value = apply_filters( 'pre_set_transient_' . $transient, $value );
    692704
    693705    if ( $_wp_using_ext_object_cache ) {
     
    21742186    if ( $upload['error'] !== false )
    21752187        return $upload;
     2188
     2189        if( is_multisite() ) {
     2190                /* WPMU check file before writing it */
     2191                $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' => $name, 'bits' => $bits, 'time' => $time ) );
     2192                if( is_array( $upload_bits_error ) == false ) {
     2193                        $upload[ 'error' ] = $upload_bits_error;
     2194                        return $upload;
     2195                }
     2196        }
    21762197
    21772198    $filename = wp_unique_filename( $upload['path'], $name );
Note: See TracChangeset for help on using the changeset viewer.