I’m trying to add/ update additional values to an option created with the Settings API. I’m trying to do this with my validation callback function, but I’m not getting very far. Here is my code:
function tccl_settings_option_validate( $input ) {
add_option( 'tccl_settings_option', $input );
}
This is causing a pretty big error. How should I be doing this?
What I would like to do is use the validation callback to add values to the option array without overwriting it.
Get the option, modify only the values you need to modify in it, then return the results.
On your tccl_settings_option_validate function you need to:
return that array.
so something like:
you don’t have to save the option, that’s done for you. your validation function should check input then
return
something.