I have created 2 roles, Center
and Student
, for my WordPress website with different capabilities using members plugin.
I want the student role users to be only able to view and edit their personal profile information and I achieved this by granting them the read capability.
Now the issue is I want the Center role users to be able to list and view student role users personal profile information without being able to edit them.
I have granted the Center role three capabilities: read
, list_users
, edit_users
with this I am able to list all users as I wanted to, I am able to view personal profile information but with the ability to edit.
I know that with edit_users
editing ability will come, but I want to know how to limit it to view or ready only, or is there any other way out.
I don’t want the Center users to be able to edit student users personal information, they should just be able to list and view the information.
I am new to WordPress and I am loving it.
Well you could do one of the following things;
user-edit.php
and create a hook telling WP that if the user role isCenter
and is trying to save other user information return an error.It actually depends on your WP knowledge and time you are whiling to invest.