Forums

[resolved] [Plugin: Aleph] Hide Admin From User List (7 posts)

  1. rzvagelsky
    Member
    Posted 2 years ago #

    How would I go about suppressing the admin profile from appearing in the user list?

    Thanks!

    http://wordpress.org/extend/plugins/el-aleph/

  2. rzvagelsky
    Member
    Posted 2 years ago #

    Anyone?

  3. tessina
    Member
    Posted 2 years ago #

    Seeking this solution too, anyone can help?

  4. tessina
    Member
    Posted 2 years ago #

    Ok, found an interim solution.

    In /base-classes/UserQuery.php
    FIND

    //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;
    				case 'registered':
    					break;
    				default:
    					$where .= " AND 1=0 ";
    					break;
    			}
    		}

    CHANGE THIS PART:

    case 'registered':
    					break;

    TO:

    case 'registered':
    					$where .= " AND $wpdb->users.ID != '1' ";
    					break;

    This change assumes you only have 1 admin user, whose user ID is 1 and will hide his/her profile from the user list page (http://example.com/people)

  5. rzvagelsky
    Member
    Posted 2 years ago #

    Thanks!

  6. Trivikrama
    Member
    Posted 1 year ago #

    May i know Where Exactly can we find the file UserQuery.php???

  7. whosies
    Member
    Posted 1 year ago #

    on the left sidebar for the dashboard under pluging you will find an editor option. after clicking that, on the right side will be a drop down menu, choose the plugin you are editing and then find the file you need.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags