Removed unused code from deactivate.php
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 18 Jan 2018 21:46:10 +0000 (16:46 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 18 Jan 2018 21:46:10 +0000 (16:46 -0500)
deactivate.php

index 2ced0eb..8bc76d1 100644 (file)
@@ -53,56 +53,15 @@ class glmMembersPluginDeactivate extends glmPluginSupport
     public function __construct ($wpdb, $config)
     {
 
-        // Make sure the current user has this capability
 /*
-        if (!current_user_can('activate_plugins')) {
-            die();
-        }
-*/
-
-        // Check if there was an error and WP is calling us again
-        if ($this->checkErrorScrape()) {
-            exit;
-        }
-
-
         // Save WordPress Database object
         $this->wpdb = $wpdb;
 
         // Save plugin configuration object
         $this->config = $config;
+*/
 
-        // Remove user capabilties
-        // $this->removeRoleCapability('glm_members_edit');
-
-
+        // Not doing anything here for now.
     }
 
-    /*
-     * Remove a role capability from all current roles
-     *
-     * @param string $capability
-     *
-     * @return void
-     * @access public
-     */
-    public function removeRoleCapability ($capability)
-    {
-        // Get list of role objects
-        $roleObjects = $GLOBALS['wp_roles']->role_objects;
-
-        // Get list of roles we can edit
-        $roles = get_editable_roles();
-
-        // For each role object
-        foreach ($roleObjects as $key => $role) {
-            // Check if the role exists in list of editable roles and capability
-            // does not exist
-            if (isset($roles[$key]) && isset($role->capabilities[$capability])) {
-
-                // Remove role
-                $role->remove_cap($capability);
-            }
-        }
-    }
 }