/** * Validate settings values * * @param array $values Settings values * @return array */ function kucrut_validate($values, $sanitize_cb = 'wp_kses_data') { foreach ($values as $key => $value) { if (is_array($value)) { $values[$key] = kucrut_validate($value); } else { $values[$key] = call_user_func_array($sanitize_cb, array($value)); } } return $values; }
/** * Update settings * * @since 0.7.0 * @access protected * @param array $values Settings values * @return string Redirect URL */ protected static function _update_settings($values) { update_option('menu-icons', wp_parse_args(kucrut_validate($values), self::$settings)); set_transient(self::TRANSIENT_KEY, 'updated', 30); $redirect_url = remove_query_arg(array('menu-icons-reset'), wp_get_referer()); return $redirect_url; }