Home › Forums › General Issues › Default values by option page on first load › Reply To: Default values by option page on first load
Ok I tested your first solution:
$white_menu = get_field('top_nav_color', 'option');
if ($white_menu === NULL) {
$white_menu = '1';
}
This is my example and it works, by including this in the specific template, where the field is called.
But, now I can’t unterstand your next solution. Is this a workaround for all true/false fields or do I have to define it for each field also?
The easier way is to write a documentation, with explaining to go to the backend and click the update button 🙂
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.