I'm storing all my options using Settings API:
function registerSettings() {
register_setting('XX_theme_settings', 'XX_theme_settings', 'setting_validate' );
add_settings_section('theme_options', 'Theme Options', 'theme_options_generate', 'page1' );
add_settings_field( 'XX_Option1', 'Option 1', 'text_input', 'page1', 'theme_options', 'XX_Option1' );
add_settings_field( 'XX_Option2', 'Option 2', 'text_input', 'page1', 'theme_options', 'XX_Option2' );
};
add_action('admin_init', 'registerSettings');
Let's say I want to update XX_Option2 manually (not using forms, but via PHP), how should I do that?
I was thinking about update_option('XX_theme_settings[XX_Option2]', value)
, but that doesn't work (?).