I need to restrict the user list in users.php to users in three custom roles. How and where do I do this?
Thank you,
Ana Rita
I need to restrict the user list in users.php to users in three custom roles. How and where do I do this?
Thank you,
Ana Rita
In UserQuery.php
//TODO: case admins, moderators, commenters, etc.
if (!empty($q['user_type'])) {
switch($q['user_type']) {
case 'authors':
$distinct .= 'DISTINCT';
$join .= " INNER JOIN $wpdb->posts ON ($wpdb->users.ID = $wpdb->posts.post_author) ";
$where .= " AND $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_status = 'publish' ";
break;
default:
$where .= " AND ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'wp_capabilities' AND meta_value RLIKE 'academic')";
break;
}
}This topic has been closed to new replies.