Skip Navigation

[Resolved] Best way to make "admin only" user fields?

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Author
Posts
#1571225

Hi,

I created a custom user role called "Teacher", and added custom user fields so the teacher can specify what their teaching specialities are, e.g. "good with dogs and children."

Then I used Toolset Forms to make a page where the teacher can edit their specialties. So far, so good!

Now: I also want to track some "administration only" fields for teachers -- things that only admins are allowed to change. For example, only an admin can specify whether a teacher has passed certain tests. (My intent is to use Toolset Views to make pages where you can see lists of teachers who have passed certain tests.)

So, I added some more custom fields for the teacher role, e.g. "Has passed level 1 certification." And I did NOT add these fields to the Toolset Forms page where the teacher edits themselves. This works great, the teacher is allowed to edit the fields I want them to, and isn't able to edit the administration-only fields.

*** However, if they go to the standard built-in wordpress /wp-admin/profile.php "edit my profile" page, they can edit all those "administration only" fields I added! ***

How do I keep teachers from using the built-in /wp-admin/profile.php editor?

Or, am I going about this the wrong way, and there's a better way for me to set up "administration only" fields for users?

#1571633

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Have you installed the Toolset access plugin? If yes: Go to:
=> Toolset => Access Control => Types Fields tab => User Meta Fields Access section => select your custom field group => uncheck the checkboxes permissions for "Modify own fields" and "View own fields in profile" for your teacher role and save the settings.

#1573583

Thanks, that's exactly what I needed. Much better than just hiding the profile editor altogether.