$admin_email = $_POST['watu_admin_email']; if(strstr($admin_email, '<')) { $parts = explode('<', $admin_email); $parts[0] = sanitize_text_field($parts[0]); $parts[1] = sanitize_email($parts[1]); $admin_email = $parts[0].' <'.$parts[1].'>'; } else $admin_email = sanitize_email($admin_email); $csv_delim = sanitize_text_field($_POST['csv_delim']); $csv_quotes = empty($_POST['csv_quotes']) ? 0 : 1; update_option( "watu_delete_db", $delete_db, false ); update_option('watu_delete_db_confirm', $delete_db_confirm, false); update_option('watu_answer_type', $answer_type, false); update_option('watu_use_the_content', $use_the_content); update_option('watu_text_captcha', wp_kses_post($_POST['text_captcha']), false); update_option('watu_debug_mode', $debug_mode, false); update_option('watu_admin_email', $admin_email, false); update_option('watu_integrate_moolamojo', $integrate_moolamojo, false); update_option('watu_quiz_word', sanitize_text_field($_POST['quiz_word']), false); update_option('watu_quiz_word_plural', sanitize_text_field($_POST['quiz_word_plural']), false); update_option('watu_csv_delim', $csv_delim, false); update_option('watu_csv_quotes', $csv_quotes, false); update_option('watu_dont_autoscroll', $dont_autoscroll, false); update_option('watu_no_ajax', $no_ajax, false); $roles = $wp_roles->roles; foreach($roles as $key=>$r) { if($key == 'administrator') continue; $role = get_role($key); // manage Watu - allow only admin change this if($is_admin) { if(!empty($_POST['manage_roles']) and is_array($_POST['manage_roles']) and in_array($key, $_POST['manage_roles'])) { if(!$role->has_cap('watu_manage')) $role->add_cap('watu_manage'); } else $role->remove_cap('watu_manage'); } // end if can_manage_options } // end foreach role print '
' . __('Options updated', 'watu') . '