Home › Forums › Invisible reCaptcha › How-To and Troubleshooting › Change settings programatically › Reply To: Change settings programatically
April 24, 2019 at 9:02 am
#12197

Florian Hartig
Participant
lol, forgot I had an account to this community and stumbled upon this entry of mine. I use an abstracted function for that now as I set many other plugins’ initial settings that way, but this is what it would look like in form of one-off code:
$array = get_option('ic-settings');
$inner_option_array = array(
'SiteKey' => 'SITEKEY',
'SecretKey' => 'SECRETKEY',
)
foreach($option_array as $option_name => $option_value) {
$array[$option_name] = $option_value;
}
update_option('ic-settings', $array);
Disclaimer: not tested in that form but I hope it might help somebody 🙂