Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirect issue – bp-core-catchuri.php

  • Avatar of trailmix5
    trailmix5
    Participant

    @trailmix5

    Hello,

    I’m using DAP as a membership plugin and it synchs to WP, so I never want the users of the site to see wp-login. I’m having a problem with the notifications emails BP sends out. For instance, on a friend request, the email will list http://www.website.com/username/settings/notifications. If a user is not logged in they will be redirected to wp-login which I don’t want. I need them to redirect to my custom login page http://www.website.com/login.

    I believe I traced it back to bp-core-catchuri.php, but my php knowledge is falling a bit short.

    I tried to modify the code to the following but it didn’t work, I’m just trying to redirect the bpnoaccess to my custom page:

    case 2 :
    if ( !empty( $redirect ) ) {
    bp_core_redirect( add_query_arg( array( ‘action’ => ‘bpnoaccess’ ), wp_login_url( $redirect ) ) );
    } else {
    bp_core_redirect( “http://YourSite.com/login/” );
    }

    There’s also this code, which I may have to change…ugh.

    $url = $root;
    if ( !empty( $redirect ) )
    $url = add_query_arg( ‘redirect_to’, urlencode( $redirect ), $root );

    if ( !empty( $message ) ) {
    bp_core_add_message( $message, ‘error’ );
    }

    bp_core_redirect( $url );

    Am I way off base here? Can someone with more knowledge help me out? Thanks so much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of @ChrisClayton
    @ChrisClayton
    Participant

    @chrisclayton

    There is filter hooks in the function which you should use instead of modifying core, but assuming you’re just modifying core for temporary testing purposes only, you will need to modify the $mode variable as it defines mode 2 (login via wp) by default (http://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-catchuri.php#L463)

    For production purposes, there is a $redirect url arg (which can be filtered with ‘bp_core_no_access’) that you should use to set your custom login.

    Avatar of trailmix5
    trailmix5
    Participant

    @trailmix5

    Hi @ChrisClayton,

    I would also rather use filter hooks, but I cannot figure out how to do it. I’ve searched everywhere, but I can’t seem to find the answer to this specific problem. Can you either show me or link me to a post where it is explained a bit? Also, would I just be modifying bp-custom.php? I understand to a certain extent, but I’m not a professional coder.

    Thanks.

    Avatar of trailmix5
    trailmix5
    Participant

    @trailmix5

    Hello,

    Does anyone out there have any other info that may help me out? I’m stuck on this small issue and I can’t seem to figure it out.

    Thanks in advance.

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

You must be logged in to reply to this topic.