Redirect protected content/registration back to referrer URL

We are in the process of re-designing our site to protect almost all the content on the main site to registered users only using Membership 2 Pro. However, there are several subsites on our multisite installation that do not require registration but point to content on the main site that will be protected by Membership 2 Pro. When they are not registered properly, they should be redirected to the registration page.

Is there any way, after they register (Buddypress registration) that they can be returned to the referrer URL?

  • Jude
    • DEV MAN

    Hi there @Randy

    This is not possible out of the box. You will need to add some custom code that captures the referrer at the start of the registration process ( maybe even as a PHP sessions variable ) and then on registration complete pass that data back to a wp_safe_redirect() method.

    Its pretty straight forward but may require hacking the core plugin files. If you're not a developer yourself consider our Jobs Board. It should not be more than a couple of hours work.

    Hope that helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.