add_settings_field() and register_setting() saving blank options?

FYI it was the ‘whitelist_options’ filter. Something like this:


public function init(){
    add_filter( 'whitelist_options', array($this, 'whitelist_options'), 100, 1);
}
	
public function whitelist_options($options){

	if(isset($options['member_settings']) && !empty($_POST['option_page']) && $_POST['option_page'] == 'member_settings'){
		// we're saving the techspace member settings area. remove options if we are attempting to save an empty field.
		foreach($options['member_settings'] as $index => $key){
			if(empty($_POST[$key])){
				unset($options['member_settings'][$index]);
			}
		}
	}
	return $options;
}