Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirect on WP_Error?

  • Avatar of menzo1
    menzo1
    Participant

    @menzo1

    Hello Buddypress,

    I am currently developping a custom theme and I’m running into some problem.

    When I run the funciton to check an activation key:
    bp_core_activate_signup($KEY)

    It doesn’t return the WP_Error class object but it’s redirecting the user and setting a cookie saying that the key is incorrect.

    In the function it does say:

    if ( empty( $user_id ) )
            {
                return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
            }

    if I use die() infront of the return, it just dies. So it does pass the if statement.

    Why is it when a WP_Error class object is being created, the browser redirects the user?

    I just want the object.

You must be logged in to reply to this topic.