From 14cfe5b483c05e2f4cc2f08c44ccf6c3fd5a5259 Mon Sep 17 00:00:00 2001 From: Luke Woodward <luke.woodward@10up.com> Date: Fri, 16 May 2014 00:18:12 -0700 Subject: [PATCH] Don't use is_multisite unless it is defined --- object-cache.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/object-cache.php b/object-cache.php index 67fedb4..0a66dd7 100644 --- a/object-cache.php +++ b/object-cache.php @@ -370,8 +370,10 @@ class WP_Object_Cache { } // Assign global and blog prefixes for use with keys - $this->global_prefix = ( is_multisite() || defined( 'CUSTOM_USER_TABLE' ) && defined( 'CUSTOM_USER_META_TABLE' ) ) ? '' : $table_prefix; - $this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix ) . ':'; + if ( function_exists( 'is_multisite' ) ) { + $this->global_prefix = ( is_multisite() || defined( 'CUSTOM_USER_TABLE' ) && defined( 'CUSTOM_USER_META_TABLE' ) ) ? '' : $table_prefix; + $this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix ) . ':'; + } } /** @@ -845,7 +847,7 @@ class WP_Object_Cache { * @return bool */ public function switch_to_blog( $_blog_id ) { - if ( ! is_multisite() ) { + if ( ! function_exists( 'is_multisite' ) || ! is_multisite() ) { return false; } -- GitLab