- This topic has 12 replies, 3 voices, and was last updated 11 years, 9 months ago by
Pie Register.
- AuthorPosts
- October 9, 2014 at 6:26 pm #10002577
freddelaParticipantMy 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 ?October 9, 2014 at 7:05 pm #10002578
Pie RegisterParticipantHello,
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
October 9, 2014 at 7:17 pm #10002580
freddelaParticipantI don’t see this setting ? Can you tell me more ?
October 9, 2014 at 7:24 pm #10002581
Pie RegisterParticipantPlease go to General Settings Page under Pie-Register Menu, here you
will find this Settings Under Login Block!Thanks
October 9, 2014 at 7:30 pm #10002585
freddelaParticipantThere is no setting Under Login Block !
October 9, 2014 at 7:37 pm #10002586
Pie RegisterParticipantOkay 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,
MohsinOctober 9, 2014 at 8:02 pm #10002588
freddelaParticipantOK 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?October 10, 2014 at 2:30 pm #10002590
Pie RegisterParticipantHi,
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
October 10, 2014 at 2:56 pm #10002592
freddelaParticipantHello,
Thanks for your answer.
What is the exact procedure. I am not specialist in php…October 10, 2014 at 5:30 pm #10002593
Pie RegisterParticipantHello,
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 - AuthorPosts
- The forum ‘Pie-Register 2.0 Support’ is closed to new topics and replies.
