delete_option('glmMembersInstallErrors');
}
+/**
+ * Check if a particular capability exists for the current user and if it's checked
+ *
+ * If $permit is already false, we just return that since we can only withdraw permission with these tests, not add it.
+ * @param $cap string Capability to check
+ * @param $permit boolean Used to pass on pre-existing permission value
+ *
+ * @return boolean True if capability exists
+ */
+$glmUser = wp_get_current_user();
+$glmMembersCaps = $glmUser->allcaps;
+function glmMembersUserCan( $cap, $permit )
+{
+ global $glmMembersCaps;
+
+ if (!$permit) {
+ return false;
+ }
+
+ if (!isset($glmMembersCaps[$cap])) {
+ return $permit;
+ }
+trigger_error('TEST',E_USER_NOTICE);
+ return current_user_can($cap);
+}