PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Registration form still accessible to logged in users

  1. I've noticed that a logged in user can still access the registration form and make use of it. Not really practical. Is there any way that the user will be redirected to the homepage on click?

    Posted 12 years ago on Sunday March 4, 2012 | Permalink
  2. Hi, ignatiusjeroe,

    You can accomplish this by adding some code using the "gform_pre_render" (http://www.gravityhelp.com/documentation/page/Gform_pre_render) hook. The example below is something you could add to your theme's functions.php file:

    //add the pre_render filter for form id = 5
    add_action("gform_pre_render_5", "redirect_logged_in_user");
    function redirect_logged_in_user()
    {
    	if (is_user_logged_in())
    	{
    		echo '<script language="javascript">location.href="http://www.rocketgenius.com"</script>';
    	}
    }
    Posted 12 years ago on Monday March 12, 2012 | Permalink

This topic has been resolved and has been closed to new replies.