WordPress Plugin Dev: Using array for WP options

If you are using the Settings API then you don’t have to save the options, that’s done for you. So when using an array to store the options your validation function should get an array of all existing options, update only the changed and return that array.

Something like this:

function my_settings_option_validate( $input ) {
    //do regular validation stuff
    //...
    //...

    //get all options
    $options = get_option('my_plugin_options');
    //update only the neede options
    foreach ($input as $key => $value){
        $options[$key] = $value;
    }
    //return all options
    return $options;
}