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

git-svn-id: http://svn.automattic.com/wordpress/trunk@15551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-08-31 18:17:20 +00:00
parent 925124db11
commit db718fc987
1 changed files with 7 additions and 8 deletions

View File

@ -87,16 +87,15 @@ function ms_site_check() {
*/
function get_current_site_name( $current_site ) {
global $wpdb;
$current_site->site_name = wp_cache_get( $current_site->id . ':current_site_name', 'site-options' );
$current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
if ( ! $current_site->site_name ) {
$current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
if ( ! $current_site->site_name ) {
$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 ) );
if ( ! $current_site->site_name )
$current_site->site_name = ucfirst( $current_site->domain );
}
wp_cache_set( $current_site->id . ':current_site_name', $current_site->site_name, 'site-options' );
$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 ) );
if ( ! $current_site->site_name )
$current_site->site_name = ucfirst( $current_site->domain );
}
wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' );
return $current_site;
}