WordPress.org

Make WordPress Core

Changeset 15551


Ignore:
Timestamp:
08/31/10 18:17:20 (4 years ago)
Author:
ryan
Message:

Cache to site_name instead of current_site_name. Props benward. fixes #14461

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-load.php

    r15333 r15551  
    8888function get_current_site_name( $current_site ) { 
    8989    global $wpdb; 
    90     $current_site->site_name = wp_cache_get( $current_site->id . ':current_site_name', 'site-options' ); 
     90 
     91    $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' ); 
    9192    if ( ! $current_site->site_name ) { 
    92         $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' ); 
    93         if ( ! $current_site->site_name ) { 
    94             $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) ); 
    95             if ( ! $current_site->site_name ) 
    96                 $current_site->site_name = ucfirst( $current_site->domain ); 
    97         } 
    98         wp_cache_set( $current_site->id . ':current_site_name', $current_site->site_name, 'site-options' ); 
    99     } 
     93        $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) ); 
     94        if ( ! $current_site->site_name ) 
     95            $current_site->site_name = ucfirst( $current_site->domain ); 
     96    } 
     97    wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' ); 
     98 
    10099    return $current_site; 
    101100} 
Note: See TracChangeset for help on using the changeset viewer.