Support

Account

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.