Brajesh Singh has a plugin for that:
https://wordpress.org/extend/plugins/bp-redirect-to-profile/
You might have to modify it to suit your needs.
Thanks r-a-y, unfortunately it looks like it won’t work, it redirect to domain/null and results in a 404. I’ll see if I can make it work, but it’s outdated for 1.1.3.
We’ll see…
Tried 1.0 as well now, just logs in and loads front page. I contacted Brajesh, hopefully he gets it working for 1.1.3.
That would be a great plugin. Makes sense to send folks to “Activity” to check the latest.
Yeah, I’m starting to pull my hair out. Perhaps this can only be accomplished using mod rewrite?
dwpers, if you figure out the way to do, would love if you could share. Sadly, I am not so knowledgeable on scripting but I watch these threads all the time to see if someone came with a solution. Cheers/A
not too sure if this is the solution that you want; but what i have on my website is that the activity stream becomes the homepage; so whenever someone registers, they go the homepage that now has the activity stream.
see it on my testing website: http://esastera.org
let me know if you’d like details on how to make the activity stream becoming the homepage.
nahrizuladib – I’d be interested to know how you made the activity stream be the homepage, would you mind sharing that with me?
Can’t you do something like this?
<?php
function login_redirect_activity ()
{
wp_redirect (get_option(‘siteurl’) . ‘/activity/’);
}
add_action (“wp_login”, “login_redirect_activity”);
?>
The location it redirects to might be wrong. Here’s the reference for the wp_redirect if you want to redirect it somewhere else: https://codex.wordpress.org/Function_Reference/wp_redirect You might have to play with it to redirect to the right place. You also might want to hook it to a different action, but this will hopefully get you closer. I’m still learning this stuff.
@duffcub
Read this:
https://buddypress.org/forums/topic/faq-how-to-code-snippets-and-solutions#post-37123
@techguy
Use bp_core_redirect();
From the commented code:
– Performs a status safe wp_redirect() that is compatible with bp_catch_uri();
eg. redirect to logged in user’s profile:
global $bp;
bp_core_redirect( $bp->loggedin_user->domain );
Thanks r-a-y. Lots to learn and I always forget there’s so many ‘duplicates’ between BP and WP.
How does the bp_core_redirect() differ from this code in the thread you linked to (besides where it redirects)?
function oci_login_redirect($redirect_to, $set_for, $user){
$redirect_to = bp_core_get_userurl($user->id);
return $redirect_to;
}
add_filter(‘login_redirect’, ‘oci_login_redirect’, 10, 3);
The plugin referenced above works fine for me on a new install.