Home › Forums › ACF PRO › Set value of ACF on user role › Reply To: Set value of ACF on user role
Hey Bee
This is on the post creation admin screen – so by default depending on the user thats logged in and their role different values would be selected.
It might not be the most elegant code but I did come up with a solution for this one
$user_access_level = current_user_can('gold');
if ( $user_access_level == true ){
$field['choices'] = array('standard', 'gold');
$field['default_value'] = 1;
}
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.