I want to restrict wordpress admin to view all users in user list.

For say, I have created custom roles (company users, employee). A company user type role can have multiple employees.

I want wordpress admin to only view company users.

I got, args in function prepare_items() inside WP_Users_List_Table class can filter this. So have tried to override this in my theme’s functions.php.

But it’s not working. How and where I can override this functionality without touching core wordpress methods?

EDIT :
This I want in admin UI.

Thanks in advance.

Read more here: Change the functionality of wordpress users module in admin


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: