/** * sanitize options value */ function sanitize_options($input) { $the_coa = FastfoodOptions::get_coa(); foreach ($the_coa as $key => $val) { $_value = NULL; if (!isset($input[$key])) { $input[$key] = NULL; } switch ($the_coa[$key]['setting']['sanitize_method']) { case 'checkbox': $_value = FastfoodSanitize::checkbox($input[$key], $the_coa[$key]); break; case 'select': $_value = FastfoodSanitize::select($input[$key], $the_coa[$key]); break; case 'radio': $_value = FastfoodSanitize::radio($input[$key], $the_coa[$key]); break; case 'color': $_value = FastfoodSanitize::color($input[$key], $the_coa[$key]); break; case 'url': $_value = FastfoodSanitize::url($input[$key], $the_coa[$key]); break; case 'text': $_value = FastfoodSanitize::text($input[$key], $the_coa[$key]); break; case 'number': $_value = FastfoodSanitize::number($input[$key], $the_coa[$key]); break; case 'textarea': $_value = FastfoodSanitize::textarea($input[$key], $the_coa[$key]); break; } $input[$key] = $_value; } return $input; }