components/Roles/Roles.php
public function count_users( $role ) {

		$count_users = count_users();

		$avail_roles = array();

		foreach ( $count_users['avail_roles'] as $count_role => $count ) {
			$avail_roles[ $count_role ] = $count;
		}

		if ( empty( $role ) ) {
			return $avail_roles;
		}

		if ( ! isset( $avail_roles[ $role ] ) ) {
			$avail_roles[ $role ] = 0;
		}

		return $avail_roles[ $role ];
	}
public function count_users( $role ) {

		$count_users = count_users();

		$avail_roles = array();

		foreach ( $count_users['avail_roles'] as $count_role => $count ) {
			$avail_roles[ $count_role ] = $count;
		}

		if ( empty( $role ) ) {
			return $avail_roles;
		}

		if ( ! isset( $avail_roles[ $role ] ) ) {
			$avail_roles[ $role ] = 0;
		}

		return $avail_roles[ $role ];
	}
public function count_users ( $ role ) { $ count_users = count_users ( ) ; $ avail_roles = array ( ) ; foreach ( $ count_users [ 'avail_roles' ] as $ count_role => $ count ) { $ avail_roles [ $ count_role ] = $ count ; } if ( empty ( $ role ) ) { return $ avail_roles ; } if ( ! isset ( $ avail_roles [ $ role ] ) ) { $ avail_roles [ $ role ] = 0 ; } return $ avail_roles [ $ role ] ; }
Basic logic from Members plugin, it counts users of a specific role

@param $role

@return array
Basic logic from Members plugin it counts users of a specific role