wpDiscuz compatibility with login urls
This topic contains 8 replies, has 3 voices, and was last updated by Brian Wilson 6 years, 2 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
September 20, 2018 at 10:07 pm #2914
Hey there,
I’m using wpDiscuz for comments which generate URL’s such as /login/?redirect_to=https://www.mywebsite.com/hello-world/ as an example.
Unfortunately, this seems to not be respected by the UsersWP plugin and I was hoping there would be a way to have it redirect based on this type of string.
If so, then wpDiscuz and UsersWP will work perfectly together.
Let me know what is possible.
September 20, 2018 at 10:31 pm #2915I’m not sure how UsersWP would do it but here’s a couple examples from other plugin integrations.
BuddyPress compatibility (add in theme functions.php file)
//////////////////////////////////////////////////////////////////////// // BuddyPress Profile URL Integration ////////////////////////////////// //////////////////////////////////////////////////////////////////////// add_filter('wpdiscuz_profile_url', 'wpdiscuz_bp_profile_url', 10, 2); function wpdiscuz_bp_profile_url($profile_url, $user) { if ($user && class_exists('BuddyPress')) { $profile_url = bp_core_get_user_domain($user->ID); } return $profile_url; }
Ultimate Member (add in themes functions.php)
//////////////////////////////////////////////////////////////////////// // Ultimate Member Profile Display Name Integration //////////////////// //////////////////////////////////////////////////////////////////////// add_filter('wpdiscuz_comment_author', 'wpdiscuz_um_author', 10, 2); function wpdiscuz_um_author($author_name, $comment) { if ($comment->user_id) { $column = 'display_name'; // Other options: 'user_login', 'user_nicename', 'nickname', 'first_name', 'last_name' if (class_exists('UM_API') || class_exists('UM')) { um_fetch_user($comment->user_id); $author_name = um_user($column); um_reset_user(); } else { $author_name = get_the_author_meta($column, $comment->user_id); } } return $author_name; } //////////////////////////////////////////////////////////////////////// // Ultimate Member Profile URL Integration ///////////////////////////// //////////////////////////////////////////////////////////////////////// add_filter('wpdiscuz_profile_url', 'wpdiscuz_um_profile_url', 10, 2); function wpdiscuz_um_profile_url($profile_url, $user) { if ($user && (class_exists('UM_API') || class_exists('UM'))) { um_fetch_user($user->ID); $profile_url = um_user_profile_url(); } return $profile_url; }
September 20, 2018 at 10:39 pm #2916If you use the following setting, then UsersWP will automatically return the user to the page he was visiting before logging in.
UsersWP > Login tab > Login Redirect Page > Last User Page.Let me know if I misunderstood. Thanks
September 20, 2018 at 10:43 pm #2917Hey Guust,
You did not misunderstand, and actually I should have been more specific.
So it does this for the standard login process, but with the Social Login specifically it just takes me to the home page of my website, rather than redirecting to the last user page as set in the settings, and rather than respecting wpdiscuz redirect url.
September 20, 2018 at 10:47 pm #2918Are you using UsersWP social login? Or another one?
https://userswp.io/downloads/social-login/Please post your URL and WP admin details in a private reply if we need to investigate anything.
Thanks
September 20, 2018 at 10:50 pm #2919This reply has been marked as private.September 21, 2018 at 12:36 am #2920Additionally, one thing I just noticed is that the author pages in WordPress are not redirecting to the profile page within UsersWP. I vaguely remember reading that this plugin should do this, but I happened to notice it wasn’t along side the other wpDiscuz issue. Am I missing a setting for this one, or is this not currently possible? Maybe a .htaccess rewrite could make it happen or something.
September 21, 2018 at 6:17 am #2925Hi Brian,
We are adding this to our tasks list and will work on it and release in next update soon. Thank you for reporting.
Regarding, Author page, it should redirect to the user profile page because we already have that functionality in UWP core. Can you please check if you have set any redirects from .htaccess or not? When I checked it redirects to the home page which is not the correct behavior.
Let me know if you have any queries.
Regards,
PatrikSeptember 21, 2018 at 7:35 pm #2932Awesome! Glad to know this will be resolved in a future release. Thanks for the great support.
Hmm… the only edit I made to the .htaccess file was redirecting http:// to https:// and simultaneously no www to www.
Here’s my htaccess.
SetEnv PHPRC /home/knowcoll/public_html/php.ini # Redirect to HTTPS RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^younglocal\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.younglocal\.com$ RewriteRule ^(.*)$ https://www.younglocal.com/$1 [R,L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # Wordfence WAF # END Wordfence WAF
Yeah home page redirect definitely isn’t right behavior but I’m not sure what could be blocking it in this file. Thanks!
Edit: I am using the maintenance/coming soon page plugin, but even when disabled it still exhibits this behavior.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket