Skip to:
Content
Pages
Categories
Search
Top
Bottom

Upon login/registration redirect to Activity Stream?


  • dwpers
    Participant

    @dwpers

    Is it possible to redirect a user to their Activity Stream? I’ve tried several related methods about redirection, but haven’t gotten it to work yet.

    I’m using BP 1.1.3 and WPMU 2.8.6

Viewing 14 replies - 1 through 14 (of 14 total)

  • dwpers
    Participant

    @dwpers

    Any ideas?


    r-a-y
    Keymaster

    @r-a-y

    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.


    dwpers
    Participant

    @dwpers

    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…


    r-a-y
    Keymaster

    @r-a-y


    dwpers
    Participant

    @dwpers

    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.


    arezki
    Participant

    @arezki

    That would be a great plugin. Makes sense to send folks to “Activity” to check the latest.


    dwpers
    Participant

    @dwpers

    Yeah, I’m starting to pull my hair out. Perhaps this can only be accomplished using mod rewrite?


    arezki
    Participant

    @arezki

    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


    nahrizuladib
    Participant

    @nahrizuladib

    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.


    duffcub
    Participant

    @duffcub

    nahrizuladib – I’d be interested to know how you made the activity stream be the homepage, would you mind sharing that with me?


    techguy
    Participant

    @crashutah

    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.


    r-a-y
    Keymaster

    @r-a-y

    @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 );


    techguy
    Participant

    @crashutah

    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);


    Scotm
    Participant

    @scotm

    The plugin referenced above works fine for me on a new install.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Upon login/registration redirect to Activity Stream?’ is closed to new replies.
Skip to toolbar