WordPress.org

Make WordPress Core

Changeset 10958


Ignore:
Timestamp:
04/16/09 22:00:39 (6 years ago)
Author:
ryan
Message:

Optimize install check by checking alloptions cache before doing a separate query. Props joostdevalk. fixes #8947

File:
1 edited

Legend:

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

    r10955 r10958  
    16801680 
    16811681    $suppress = $wpdb->suppress_errors(); 
    1682     $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" ); 
     1682    $alloptions = wp_load_alloptions(); 
     1683    // If siteurl is not set to autoload, but other options are loaded, check if it's there 
     1684    if ( !isset($alloptions['siteurl']) && count($alloptions) > 1 ) 
     1685        $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" ); 
     1686    else  
     1687        $installed = $alloptions['siteurl']; 
    16831688    $wpdb->suppress_errors($suppress); 
    16841689 
Note: See TracChangeset for help on using the changeset viewer.