I have this code in Wordpress, with undefined index error for $option_name
. The options are saving correctly but I'm getting the error.
I have it wrapped with isset
so I'm not understanding the problem.
if (isset ($_POST['update_theme_options'])) {
$option_name_array = array_keys($slider_options);
foreach ($option_name_array as $option_name):
if(isset($slider_options[$option_name])):
$slider_options[$option_name] = $_POST[$option_name];
endif;
endforeach;
update_option('slider_settings', $slider_options);
}`