I've used this in other functions, but it doesn't seem to work in this particular one...
<?php
$page = get_the_title();
$blogusers = get_users('orderby=display_name');
foreach ($blogusers as $user) {
$cpt_count = wpse31443_author_has_custom_post_type( $user->ID, $page );
if (!empty($cpt_count)) {
echo '<li>' . $user->display_name . '' . $cpt_count1 . '</li>';
}
}
?>
If I change $page = get_the_title();
to $page = 'title';
then it works, so it's something with get_the_title(); but I'm not sure what because it has worked in other functions.