Home › Forums › ACF PRO › Options Page: First Use › Reply To: Options Page: First Use
You can look at this: http://www.advancedcustomfields.com/resources/functions/update_field/, as well as http://codex.wordpress.org/Plugin_API/Action_Reference/after_switch_theme and http://codex.wordpress.org/Plugin_API/Action_Reference/switch_theme
But this feels like fixing a problem that could have been prevented in the first place by applying some basic coding standards.
For me, basic value validation is an automatic thing and I think much easier to deal with then building a script to populate the database when my theme is activated.
Do you attempt to echo $_POST[‘some_key’] before you test to see if it has a value? Well, if you don’t care about warnings and errors, or security I guess. Personally I don’t use any value unless I’m sure I know what it contains before I use it; that’s just basic security and PHP best practices.
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.