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!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.