ngg_get_role
The NextGEN Gallery ngg get role function.
Description
ngg_get_role( $capability );
Parameters (1)
- 0. $capability
- The capability.
Usage
if ( !function_exists( 'ngg_get_role' ) ) { require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/roles.php'; } // The capability. $capability = null; // NOTICE! Understand what this does before running. $result = ngg_get_role($capability);
Defined (1)
The function is defined in the following location(s).
- /products/photocrati_nextgen/modules/ngglegacy/admin/roles.php
- function ngg_get_role($capability) {
- // This function return the lowest roles which has the capabilities
- $check_order = ngg_get_sorted_roles();
- $args = array_slice(func_get_args(), 1);
- $args = array_merge(array($capability), $args);
- foreach ($check_order as $check_role) {
- if ( empty($check_role) )
- return false;
- if (call_user_func_array(array(&$check_role, 'has_cap'), $args))
- return $check_role->name;
- }
- return false;
- }