Redirect After Login

I had my site setup to redirect to /vip-freebies after logging in, but with Facebook plugin it just refreshes to a logged in version without redirecting.

Does anyone know what the problem is here or how to solve it?

- Chelsea

  • DavidM
    • DEV MAN’s Mascot

    Hi Chelsea,

    Hmm, it seems the plugin handles redirects itself. I'll ask the developer to have a look here but for now, you can make a minor change in the plugin code to redirect to any url you'd like.

    To do so, you can open up the following file:

    On line 125 you'll see this.
    echo '<p><fb:login-button perms="' . WDFB_EXTENDED_PERMISSIONS . '" redirect-url="' . admin_url() . '">' . __("Login with Facebook", 'wdfb') . '</fb:login-button></p>';

    If you're not using BuddyPress, you can change the admin_url() part of that line to '' or whatever else url you'd like to redirect to (being sure to include the single quotes).

    And if you're using BuddyPress, you can make a similar edit on line 133:
    echo '<p><fb:login-button perms="' . WDFB_EXTENDED_PERMISSIONS . '" redirect-url="' . home_url() . '">' . __("Login with Facebook", 'wdfb') . '</fb:login-button></p>';

    There you can change home_url() to '' or whatever url you'd like to redirect to.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.