Home › Forums › Bug Reports › acf_get_value notice incorrect › Reply To: acf_get_value notice incorrect
This:
The notice is just suppressed when you wrap all code in acf/init hook but the return value is still incorrect, it’s different when using the key to get the value. It would return
1
instead oftrue
…
is an indication that ACF is not finding the field key reference in order to get the field definition. It can also be caused by other filters, most notably pre_get_post filters.
In the former case ACF stores a value of 1 in the DB for a true/false field. If it cannot locate the field definition then it returns whatever value is stored in the DB without formatting it correctly.
The latter case can be very difficult to track down then exact cause.
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.