Home › Forums › Bug Reports › user field doesn't return value › Reply To: user field doesn't return value
Hi @bortolo
ACF will only save the data to the database when you save the object (in this case the users). When you set the default value on the field group editor, it won’t automatically change all of the old data you have as it can cause a performance issue.
Instead, you need to save the old object or set the default value in your code like this:
$subscribe = get_field('my-field', 'user_99');
if( !$subscribe ){
$subscribe == true
}
I hope this makes sense 🙂
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.