I am setting up a plugin and have used the setting API for the first time to create a form in settings. The data for the plugin is initially created by default when the plugin is activated and stored in the database in a serialized format.
Today I added the validation callback function, which works fine to do validation. However when any field fails validation and the function returns false (I have also tried returning NULL) the existing valid data in the database is deleted.
Question is this how things are supposed to happen or am I doing something stupid? I would have expected in this situation that the existing valid data in the database would have remained unaltered until such time as the user had presented a set of valid data to alter it.
Any suggestions appreciated.