• Resolved smartlemon

    (@smartlemon)


    Hi, i would like to “redirect” a user after registration to the actual page -> in detail to refresh the page.

    With Login this option is possible, but i dont see it for registration.

    thx!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @smartlemon

    You can try adding the following code snippets to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code:

    add_action("um_registration_after_auto_login","um_050621_redirect_to", 1, 1 );
    function um_050621_redirect_to( $user_id ){
               wp_redirect( get_the_permalink() ); exit;
    }

    The above code will redirect the user after registration to the active page.

    Regards,

    Thread Starter smartlemon

    (@smartlemon)

    Hi, thx.
    But i would need this only for a specific usergroup, is this also possible?
    regards, christian

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @smartlemon

    You can try this for specific user role:

    add_action("um_registration_after_auto_login","um_050621_redirect_to", 1, 1 );
    function um_050621_redirect_to( $user_id ){
           um_fetch_user( $user_id );
           if( "subscriber" == um_user("role") ){
              wp_redirect( get_the_permalink() ); exit;
           }
       
    }

    Just change the subscriber role to your preferred role slug.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @smartlemon

    …This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirection Registration’ is closed to new replies.