From a77ea8d6325fdfa932e895d52adf2c09727c1267 Mon Sep 17 00:00:00 2001 From: nacin Date: Sun, 2 May 2010 22:08:05 +0000 Subject: [PATCH] Only query for global_terms_enabled once. git-svn-id: http://svn.automattic.com/wordpress/trunk@14344 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index c0e6c2c3c..e52fb11a6 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -3763,10 +3763,13 @@ function is_main_site( $blog_id = '' ) { * @return bool True if multisite and global terms enabled */ function global_terms_enabled() { - if ( is_multisite() && '1' == get_site_option( 'global_terms_enabled' ) ) - return true; + if ( ! is_multisite() ) + return false; - return false; + static $global_terms = null; + if ( is_null( $global_terms ) ) + $global_terms = (bool) get_site_option( 'global_terms_enabled' ); + return $global_terms; } /**