function redirect_to_profile() { $who = strtolower(sanitize_user($_POST['log'])); $redirect_to = get_option('home') . '/profile?' . $who; return $redirect_to; } add_filter('login_redirect', 'redirect_to_profile');