/**
 * Conditional tag to check if a role has any users.
 *
 * @since  1.0.0
 * @access public
 * @return bool
 */
function members_role_has_users($role)
{
    return in_array($role, members_get_active_role_slugs());
}
 /**
  * Returns an array of views for the list table.
  *
  * @since  1.0.0
  * @access protected
  * @return array
  */
 protected function get_views()
 {
     $active = members_get_role_group('active');
     $inactive = members_get_role_group('inactive');
     if ($active) {
         $active->roles = members_get_active_role_slugs();
     }
     if ($inactive) {
         $inactive->roles = members_get_inactive_role_slugs();
     }
     $views = array();
     $current = ' class="current"';
     $all_count = count(members_get_role_slugs());
     // Add the default/all view.
     $views['all'] = sprintf('<a%s href="%s">%s</a>', 'all' === $this->role_view ? $current : '', esc_url(members_get_edit_roles_url()), sprintf(_n('All %s', 'All %s', $all_count, 'members'), sprintf('<span class="count">(%s)</span>', number_format_i18n($all_count))));
     // Loop through the role groups and put them into the view list.
     foreach (members_get_role_groups() as $group) {
         // Skip role groups that shouldn't be shown in the view list.
         if (!$group->show_in_view_list) {
             continue;
         }
         $count = count($group->roles);
         // Skip any views with 0 roles.
         if (0 >= $count) {
             continue;
         }
         $noop = $group->label_count;
         // Add the view link.
         $views[$group->name] = sprintf('<a%s href="%s">%s</a>', $group->name === $this->role_view ? $current : '', 'all' === $group->name ? esc_url(members_get_edit_roles_url()) : esc_url(members_get_role_view_url($group->name)), sprintf(translate_nooped_plural($noop, $count, $noop['domain']), sprintf('<span class="count">(%s)</span>', number_format_i18n($count))));
     }
     return apply_filters('members_manage_roles_views', $views, $this->role_view, members_get_edit_roles_url());
 }