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);
- }
- }
- }
}