• 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

Viewing 1 replies (of 1 total)
  • Thread Starter AnaRita

    (@anarita)

    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;
    			}
    		}
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Aleph] Filter user list by role’ is closed to new replies.