Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirect users to their notifications after login

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

  • shanebp
    Moderator

    @shanebp

    Try:
    return bp_loggedin_user_domain() . 'notifications/';


    jessicana
    Participant

    @jessicana

    This did not work. It simply redirects to:
    http://www.DOMAINNAME.com/notifications/

    404 Error page


    shanebp
    Moderator

    @shanebp

    Try this:

    function jessicana_redirect_page( $redirect_to, $request, $user ) {
        $redirect_to = bp_core_get_user_domain($user->ID) . 'notifications/';
        return $redirect_to;
    }
    add_filter('login_redirect', 'jessicana_redirect_page', 11, 3);

    jessicana
    Participant

    @jessicana

    This is a killer code 🙂
    Yes it worked darling


    jessicana
    Participant

    @jessicana

    One more question. What if I want users who logs in using the sidebar widget to return to the same page where they were while I want users who logs in using homepage link to be directed to their notifications page?


    jessicana
    Participant

    @jessicana

    In other way, I will be using this code for the whole site except login widgets (like BBpress log in sidebar widget):

    function jessicana_redirect_page( $redirect_to, $request, $user ) {
        $redirect_to = bp_core_get_user_domain($user->ID) . 'notifications/';
        return $redirect_to;
    }
    add_filter('login_redirect', 'jessicana_redirect_page', 11, 3);

    For widgets, I need a different function that redirects to the same page where users logs from. Is this possible?

    I appreciate the help

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Redirect users to their notifications after login’ is closed to new replies.
Skip to toolbar