How to save default values into an option and delete those upon actvation and deactivation in wordpress?

The following code worked. According to the comment by Milo, I have been doing it wrong by using the option name. So instead I used each keys from the option and used the array to pass the defaults. Thanks milo! :_ register_activation_hook( __FILE__, ‘twmm_activate’); //activate plugin options open activation of plugin register_deactivation_hook(__FILE__, ‘twmm_deactivate’); //deactivate plugin … Read more

plugins_loaded action is not working properly

plugins_loaded is going to load this form much too early, even if you weren’t getting errors. The form is loading before the opening <html tags. You need to select better hooks for this– admin_notices maybe, but it is hard to tell exactly what you want. Second, you need to separate your handler: function process_wpse_194468() { … Read more