i placed 'Gravity Forms User Registration Add-On's login widget in a page that registered users can login to my site. how do i redirect users to previous page that came from to login page after they submit login form?

  • Hi, welcome to the site. Unfortunately, support questions for this plugin is off topic. Please contact the plugin author or make use of its support route. – Lea Cohen Jun 22 '17 at 10:40
  • Hi and thank you. can't you help me solve this issue as this is a wordpress topic, please – Pirlanta Web Jun 22 '17 at 10:46
  • or show me another way to use a login plugin in custom page, and then redirect them to previous page ?? – Pirlanta Web Jun 22 '17 at 10:50
  • Hi, I don't know enough about gravity form to help you. You can try their support: gravityhelp.com/support – Lea Cohen Jun 22 '17 at 11:02

by help of gravity forms documentation i wrote this code , but it doesn't work!


function redirect_mylogin ( $login_redirect, $sign_on ) {
//here is redirection code
$login_redirect = esc_url( $_SERVER['HTTP_REFERER'] );
return $login_redirect; }
add_filter( 'gform_user_registration_login_redirect_url','redirect_mylogin', 10, 2 );

please help!


here is the solution :

add_filter('gform_user_registration_login_args','registration_login_args',10, 1);
function registration_login_args( $args )
$args['login_redirect'] = rgpost('login_redirect') ? rgpost('login_redirect') : RGForms::get('HTTP_REFERER', $_SERVER);
return $args;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.