Dave_F
Forum Replies Created
-
Thanks a lot messica.
I solved my problem by making a couple of changes to login.php in pmpro’s includes folder, as follows:
A feature request would be add this as a configurable option to pmpro.
Thanks for your help all.
//is a user logging in? if(!empty($user->ID)) { //logging in, let's figure out where to send them /*if(pmpro_isAdmin($user->ID)) { //admins go to dashboard $redirect_to = get_bloginfo("url") . "/wp-admin/"; } else*/ if(strpos($redirect_to, "checkout") !== false) { //if the redirect url includes the word checkout, leave it alone } elseif($wpdb->get_var("SELECT membership_id FROM $wpdb->pmpro_memberships_users WHERE status = 'active' AND user_id = '" . $user->ID . "' LIMIT 1")) { //if logged in and a member, send to the homepage $redirect_to = get_bloginfo("url"); } else { //not a member, send to subscription page $redirect_to = pmpro_url("levels"); }
Thanks H-master.
It’s not a theme conflict actually, it’s because of that code snippet above which I added to the theme functions.php
With an unmodified theme, it all works.
I’d like users to be redirected to the homepage on login/logout, and the code snippet above achieves that, but seems to break the pmpro registration process.
If there’s some way to achieve the same effect without breaking pmpro that would be fantastic. Presumably this must be a fairly common problem when building web applications using pmpro?
Well… I had added this to my theme functions:
add_action('wp_logout','go_home'); add_action('wp_login','go_home'); function go_home(){ wp_redirect( home_url() ); exit();
And it turns out this was causing the problem. Now I just need a way to redirect login to the homepage without breaking pmpro.
I tried disabling all other plugins other than PMPro, but unfortunately no luck.
So I tried switching to twenty fourteen theme and now it works. So it looks like a theme conflict of some sort. I’ll be sure to update this thread if I find the answer.
Any tips or suggestions still really appreciated!
Other plugins I have active:
BAW Login/Logout
Contact Form 7
Easy Coming Soon
Email Log
Hide Admin Bar
Limit Login Attempts
Paid Memberships Pro
SendFeed
Subscribe2
Widget Logic
WP Favorite Posts
WP Missed ScheduleAny help or debugging ideas much appreciated