By disabled I mean I don’t want a particular user type to be able to edit this field, so when they click on it in the backend they cannot change its value, but other user type would be able to edit its value … and ideally I’d also like to hide this field but thats not too much of a problem as I could just hide the field with CSS
I’ve read this here which looks exactly like what I need
You may notice that code is setting a different value of this field depending on the user role – that is actually working correctly so this piece of code is set up correctly but the field is not disabled or hidden in the backend, I try logging in as my test users for the different roles, standard and gold, go to create a new post but I still see this field and I am able to edit it for both the standard and gold users (but I do see its default value change as stated in the above code) … I feel like maybe I’m misunderstanding the use of ‘$field[‘disabled’] = true;’
I hope my question is clear, if anyone can point me in the right direction I’d be so appreciative! 🙂
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users