Default values automatically save in database when plugin will be activated

I have used a WordPress Settings API PHP Class framework, that found there http://tareq.wedevs.com/2012/06/wordpress-settings-api-php-class/, to create my first plugin setting page. Everything is working fine except default option values are not saving in database until I hit “Save” going to setting page. But I would like this to be saved automatically when someone activate the plugin. I tried using register_activation_hook() but failed. I am not sure how to use that framework with register_activation_hook(). You can check the codes going to the link I mentioned above. I am about to finish my first plugin but stuck on this. Please somebody help.

Read more here: Default values automatically save in database when plugin will be activated

Leave a Reply

Your email address will not be published. Required fields are marked *