Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirect after subscription

  • @fourmi

    Participant

    Hi!
    I’m trying to change the URL of the redirection after subscribing to a forum, based on where I’m coming from.

    I have subscription buttons on both the forum pages and a page with a list of all forums. When I subscribe from the forum page I want to stay there (it works fine), and when I subscribe from the list I want to go back to the list but instead I am redirected to the page of the forum I just subscribed to.

    Looking at the comment in the code (“Redirect back from whence we came”) I feel like what I want to do is actually how it’s supposed to work but it’s not working for me (I fall in the last else).

    Any idea how I could achieve this?
    Thanks in advance!!

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

    Keymaster

    Thanks for the topic @fourmi 🙂

    You are correct, looking at that code for forum subscriptions, if you successfully subscribe to a forum then true === $success so and then is_single() || is_page() would be true in your case the redirect should redirect to your page via get_permalink()

    Could you confirm that the user IS successfully subscribed when subscribing via your forum list page please @fourmi

    Ref: https://bbpress.trac.wordpress.org/browser/tags/2.5.10/includes/users/functions.php#L1203

    @fourmi

    Participant

    Hi Stephen, thank you for your reply! 🙂
    The user is indeed successfully subscribe, the button is working fine except for the redirection.

    @rogerlridge

    Participant

    Does anybody know or find any resolution for this? I am having the same issue and was wondering if this was ever resolved? Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar