ngg_remove_capability

Deregister a capability from all classic roles.

Description

ngg_remove_capability( (string) $capability ); 

Parameters (1)

0. $capability (string)
Name of the capability which should be deregister

Usage

  1. if ( !function_exists( 'ngg_remove_capability' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/install.php'; 
  3.  
  4. // name of the capability which should be deregister 
  5. $capability = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ngg_remove_capability($capability); 
  9.  

Defined (1)

The function is defined in the following location(s).

/products/photocrati_nextgen/modules/ngglegacy/admin/install.php  
  1. function ngg_remove_capability($capability) { 
  2. // this function remove the $capability only from the classic roles 
  3. $check_order = array("subscriber", "contributor", "author", "editor", "administrator"); 
  4.  
  5. foreach ($check_order as $role) { 
  6. $role = get_role($role); 
  7. if (!is_null($role)) 
  8. $role->remove_cap($capability) ; 
  9.