From b54e64fd1a7f9a65c18f907f69252b40e8039559 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sun, 2 May 2010 22:08:05 +0000 Subject: [PATCH] Only query for global_terms_enabled once. git-svn-id: https://develop.svn.wordpress.org/trunk@14344 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 c0e6c2c3c1..e52fb11a60 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; } /**