ngg_get_role

The NextGEN Gallery ngg get role function.

Description

ngg_get_role( $capability ); 

Parameters (1)

0. $capability
The capability.

Usage

  1. if ( !function_exists( 'ngg_get_role' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php'; 
  3.  
  4. // The capability. 
  5. $capability = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ngg_get_role($capability); 
  9.  

Defined (1)

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

/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php  
  1. function ngg_get_role($capability) { 
  2. // This function return the lowest roles which has the capabilities 
  3. $check_order = ngg_get_sorted_roles(); 
  4.  
  5. $args = array_slice(func_get_args(), 1); 
  6. $args = array_merge(array($capability), $args); 
  7.  
  8. foreach ($check_order as $check_role) { 
  9. if ( empty($check_role) ) 
  10. return false; 
  11.  
  12. if (call_user_func_array(array(&$check_role, 'has_cap'), $args)) 
  13. return $check_role->name; 
  14. return false;