Thanks for your quick reaction scribu.
I’m new to wp and php, so i’m not familiar with the functions and variables inside the code example.
I’m not sure how to apply your suggestion to my code, because I want to test on the roles in their Dutch translated names like this:
<?php
/* Loop through users to search for the admin and editor users. */
//list each role and each user with that role
global $wp_roles;
foreach( $wp_roles->role_names as $role => $name )
{
$name = translate_with_context($name);
if($name == 'Beheerder' || $name == 'Bewerker')
{
//echo '+Users in the role '.$role .' ('. $name . '):';
$this_role = "'[[:<:]]".$role."[[:>:]]'";
$query = "SELECT * FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'wp_capabilities' AND meta_value RLIKE $this_role) ORDER BY user_nicename ASC LIMIT 10000";
$users_of_this_role = $wpdb->get_results($query);
if ($users_of_this_role)
{
foreach($users_of_this_role as $user)
{
$curuser = get_userdata($user->ID);
$author_post_url=get_author_posts_url($curuser->ID, $curuser->nicename);
echo "<div class='post'>";
echo "<a href='.$user_link.' title='.$curuser->display_name.'>";
echo "<h2>$curuser->display_name</h2>";
echo '</a>';
echo "<a href='.$user_link.' title='.$curuser->display_name'>";
echo get_avatar($curuser->user_email, '80', $avatar);
echo '</a>';
echo ''.$curuser->description.'';
echo '</div>';
}
}
}
}
?>
How should I use this array to get the same functionality?
$roles = array('Beheerder', 'Bewerker', 'Auteur', 'Abonnee');
“Beheerder” is an admin
“Bewerker” is an editor
“Auteur” is an author
“Abonnee” is a subscriber