Home › Forums › General Issues › Allow roles to be set to certain users › Reply To: Allow roles to be set to certain users
Cool thanks Elliot, so do I just drop this bit of code into my functions.php file in my theme? Do I need to write any of the code from the acf/load_field filter resources link?
Is there a tweak to the code you have above that can still make the fields visible/editable by admin. So:
// compare and completely remove field if this user is not meant to see it! Unless they are admin, then always show it
if( $current_user_name != $user {but do show if the user is admin} )
{
$field = null;
}
return $field;
}
Really appreciate your help!!!
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.