Settings API – how to update options manually?

That’s because your options are stored as a serialised array, in one row with name XX_theme_settings. To update one option, you would still need to retrieve the existing settings, ammend the appropriate value and update all options in your array together.

For example:

$my_options= get_option('XX_theme_settings');//retrieve all options
$my_options['XX_Option2'] = 'my new value'; //amend value in array(s)
update_option('XX_theme_settings', $my_options); //update option array

Leave a Comment