theThe function add_optionupdate_option
includes action hooks that you can use. For your case, the best is to use
Use add_option_update_option_{$option_key}
as shown here:
function my_func($option, $value) {
//this is called only when that particular option is addedupdated
//$option has the option key & $value has the value array
}
add_action('add_option_testimonials_settings''update_option_testimonials_settings', 'my_func', 10, 2);
Though, if possible, you should directly insert inside the table & not use options. If not that, atleast try to use update_option
in place of add_option
otherwise you'll need regular cleanups of that table(maybe via a cron?). If you use update_option
, the hook is similar update_option_{$option_key}
& parameters are old value & new value