Home › Forums › Feature Requests › Feature Request: Hidden / Disabled Field Type › Reply To: Feature Request: Hidden / Disabled Field Type
I’d like to second this; I’ve been needing it lately as well.
I coded a manual hidden field type that stores the latest date each time the user saves the page for a client; I’m putting it on GitHub as we speak.
It can be easily adapted to function just as a hidden field; look into the function update_value() on line 210 to accomplish this. Removing line 212 should do the trick 🙂
Note that it might not be the most pretty solution (it’s the first field type I coded), but it works.
I’ll take a look if I can tidy it up a bit; and built it into a plugin so that it’s easier to use. Hope you find it useful 🙂
//edit: you can find the field type here: https://github.com/gport/acf-hidden-field
//edit 2: if you look into the function create_field() on line 84, you can also change the output of the HTML. Currently, the hidden field is simply set as display: none, but you could easily remove this and disable the field as well.
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!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.