function save_credits() { check_admin_referer(__CLASS__); $page_options = explode(',', stripslashes($_POST['page_options'])); if ($page_options) { $options = Footer_Credits_Options::get_options(); foreach ($page_options as $option) { $val = array_key_exists($option, $_POST) ? trim(stripslashes($_POST[$option])) : ''; if (Footer_Credits_Options::is_terms_key($option)) { $options['terms'][$option] = $val; } else { switch ($option) { case 'footer_remove': $options[$option] = !empty($val); break; case 'footer_hook': case 'footer_filter_hook': $options[$option] = preg_replace('/\\W/', '', $val); break; default: $options[$option] = trim($val); } } } //end for ; $saved = Footer_Credits_Options::save_options($options); $message = $saved ? 'updated successfully' : 'have not been updated'; $is_error = false; } else { $message = 'not found!'; $is_error = true; } $this->add_admin_notice('Footer Settings ', $message, $is_error); return $saved; }