From: Laury GvR Date: Fri, 4 Jan 2019 14:48:40 +0000 (-0500) Subject: Plugin now uses appropriate prefix variable if on a multisite installation X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e884332621e4e9c6f4c928b37a04bab6cefdfe47;p=WP-Plugins%2Fglm-member-db-contacts.git Plugin now uses appropriate prefix variable if on a multisite installation --- diff --git a/setup/adminTabs.php b/setup/adminTabs.php index 52a0947..75566ae 100644 --- a/setup/adminTabs.php +++ b/setup/adminTabs.php @@ -53,10 +53,17 @@ add_filter('glm-member-db-add-tab-for-members', // If user can manage all members if (current_user_can('glm_members_member')) { + // Check whether site is multisite + if ( is_multisite() ) { + $userTablePrefix = $this->wpdb->base_prefix; + } else { + $userTablePrefix = $this->wpdb->prefix; + } + // We need to check if they manage multiple members $other_members_refs = $this->wpdb->get_var( "SELECT meta_value - FROM " . $this->wpdb->prefix . "usermeta + FROM " . $userTablePrefix . "usermeta WHERE meta_key = 'glmMembersContactMembers' AND user_id = " . $this->config['loggedInUser']['wpUser']['ID'] );