From: Chuck Scott Date: Wed, 20 May 2015 17:46:06 +0000 (-0400) Subject: Clearing and resetting administrator capabilities for plugin X-Git-Tag: v1.0.0~16 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=f1823095442a22a1afbaa39ab1764b887b8970ec;p=WP-Plugins%2Fglm-member-db.git Clearing and resetting administrator capabilities for plugin --- diff --git a/activate.php b/activate.php index 9b3d6798..59a9270a 100644 --- a/activate.php +++ b/activate.php @@ -100,6 +100,7 @@ class glmMembersPluginActivate extends glmPluginSupport // Add user capabilties $this->addRoleCapability('glm_members_edit', array( + 'administrator' => true, 'author' => false, 'contributor' => false, 'editor' => true, @@ -108,6 +109,7 @@ class glmMembersPluginActivate extends glmPluginSupport ); $this->addRoleCapability('glm_members_configure', array( + 'administrator' => true, 'author' => false, 'contributor' => false, 'editor' => false, @@ -116,6 +118,7 @@ class glmMembersPluginActivate extends glmPluginSupport ); $this->addRoleCapability('glm_members_info', array( + 'administrator' => true, 'author' => false, 'contributor' => false, 'editor' => true, @@ -334,6 +337,11 @@ class glmMembersPluginActivate extends glmPluginSupport // For each role object foreach ($roleObjects as $key => $role) { + // Uncomment to reset capabilities + if ( isset($role->capabilities[$capability])) { + $role->remove_cap($capability); + } + // Check if the role exists in list of editable roles and // the capability does not exist if (isset($roles[$key]) && ! isset($role->capabilities[$capability])) {