No redirection

This topic contains 12 replies, has 3 voices, and was last updated by Avatar Pie Register 4 years, 10 months ago.

Viewing 10 posts - 1 through 10 (of 13 total)
  • Author
    Posts
  • #10002577
    Avatar
    freddela
    Participant

    My site contains a private page. It is accessible from a page that contains a form made ??with Pie Register (shortcode [pie_register_login]).
    When a person is registered in my site, it uses this identification form and click the submit button to go directly to this page.
    For the redirection, I use the Peters Login Redirect plugin.
    And it does not work because it is the home page of the site that is displayed!
    When I disable Pie Register and authenticate with the standard WordPress login, it works, I get right on the good page !
    Can you tell me what is wrong ?

    #10002578
    Avatar
    Pie Register
    Participant

    Hello,

    Why dont you use Pie-Register Login Redirect Functionality? Pie-Register
    has built-in Redirect feature which may conflict with the Peter Login
    Redirect. Please try to disable Peter Login Redirect, and on PR general
    Settings page please set the Landing Page Users would land on after Login.

    Thanks

    #10002580
    Avatar
    freddela
    Participant

    I don’t see this setting ? Can you tell me more ?

    #10002581
    Avatar
    Pie Register
    Participant

    Please go to General Settings Page under Pie-Register Menu, here you
    will find this Settings Under Login Block!

    Thanks

    #10002585
    Avatar
    freddela
    Participant

    There is no setting Under Login Block !

    #10002586
    Avatar
    Pie Register
    Participant

    Okay apologize for inconvenience, it’s under “URL Settings” the Last
    Drop Down where it reads: “After Sign-in Page”. Please select page you
    would like user to get redirected to,.

    Best regards,
    Mohsin

    #10002588
    Avatar
    freddela
    Participant

    OK that’s works thank you.
    But i have another problem : If there are multiple users, each with its own private page, how can I make a redirection for each user?

    #10002590
    Avatar
    Pie Register
    Participant

    Hi,

    You may want to use PR Hook “piereg_user_login_before_redirect_hook” to
    redirect User on different Landing pages. This Hook passes the user
    object. Please let me know if you have any questions!

    Thanks

    #10002592
    Avatar
    freddela
    Participant

    Hello,

    Thanks for your answer.
    What is the exact procedure. I am not specialist in php…

    #10002593
    Avatar
    Pie Register
    Participant

    Hello,

    You may try something like that:

    add_action("piereg_user_login_before_redirect_hook","pie_custom_redirect_cb",10,1);
    function pie_custom_redirect_cb($user){
    	if(in_array( "subscriber", (array) $user->roles )){
    		wp_safe_redirect('/subscriber-landing-page-slug');
    	}elseif(in_array( "editor", (array) $user->roles )){
    		wp_safe_redirect('/editor-landing-page-slug');
    	}
    	return false;
    }

    Please put this snippet into the functions.php of your theme. Please make sure you make the backup of your file before adding this code, so you can roll back in case of any inconvenience!

    This code is not tested, given to you for just to give you an idea of how to implement the redirect based on different User Roles on Pie-Register Login Hook.

    If you would like us to write a proper custom code for you, you may request for quote using rfq form at our website.

    Thanks
    Mohsin

Viewing 10 posts - 1 through 10 (of 13 total)

The forum ‘Pie-Register 2.0 Support’ is closed to new topics and replies.