Home › Forums › General Issues › is it safe to add properties to acf object ? › Reply To: is it safe to add properties to acf object ?
ok ! indeed you are right, it will not be saved in the database, so that does not help me, I need to find another way 🙂
What additional information i need to store ? it depends, but sometimes I would like to store additional information about a field, for example I used the value:label of the checkbox to store information in the ‘value’ part, and then i did some string manipulation to extract the values (ie. separating the portions with slash : for_action_email_notification/7days : send email
-> extract the ‘7days’ part with explode('/', $value)[1]
)
but it’s just a trick, I could also use one of the class or id of the field or it’s wrapper the same way, but I’m only cheating by using a property that is not made for that
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.