Home › Forums › ACF PRO › Hide a field in backend if non admin › Reply To: Hide a field in backend if non admin
No, that is not a good way to hide a field. Not returning the field from the filter is causing several PHP errors that you’re probably not seeing.
There isn’t any way using PHP or filters that will let you hide an individual field based on the current user.
If you want to have fields that that user can see and separate fields that only an admin can see then create 2 field groups. Put the fields the user is allowed to edit in the first and set the second field group’s location rules to only allow it to display based on the current user’s role.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.