Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I get redirect to the groups diectory page after login?

  • @bpinspire

    Participant

    I try to find a way for users to get redirect it to the groups directory page after login, anyone?

Viewing 3 replies - 1 through 3 (of 3 total)
  • @sbrajesh

    Participant

    Put his inside bp-custom.php and it will redirect the users to group directory

    <?php
    add_filter("login_redirect","bpdev_redirect_to_group",100,3);

    function bpdev_redirect_to_group($redirect_to_calculated,$redirect_url_specified,$user)
    {
    /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/
    if(empty($redirect_to_calculated))
    $redirect_to_calculated=admin_url();

    /*if the user is not site admin,redirect to group directory*/
    if(!is_site_admin($user->user_login))
    return bp_get_root_domain()."/".BP_GROUPS_SLUG;
    else
    return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/

    }
    ?>

    Hope it helps :)

    @bpinspire

    Participant

    @brajesh thank you so much! It worked

    @chrismackintosh

    Participant

    Thank you for this @sbrajesh

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I get redirect to the groups diectory page after login?’ is closed to new replies.
Skip to toolbar