Set global is_blog_installed flag so we don't query the DB more than once per load.
git-svn-id: http://svn.automattic.com/wordpress/trunk@6244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a8d380c32c
commit
16411f9c7b
|
@ -909,12 +909,18 @@ function do_robots() {
|
|||
|
||||
|
||||
function is_blog_installed() {
|
||||
global $wpdb;
|
||||
global $wpdb, $wp_is_blog_installed;
|
||||
|
||||
// Set flag so we don't do the query more than once.
|
||||
if ( isset($wp_is_blog_installed) )
|
||||
return $wp_is_blog_installed;
|
||||
|
||||
$wpdb->hide_errors();
|
||||
$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
|
||||
$wpdb->show_errors();
|
||||
|
||||
return !empty( $installed );
|
||||
$wp_is_blog_installed = !empty( $installed ) ? true : false;
|
||||
return $wp_is_blog_installed;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue