Redirect when Event is Updated

Home Forums Calendar Products Events Calendar PRO Redirect when Event is Updated

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #739990
    irishrunner16
    Participant

    Hi guys. Sorry for the double post, but I think my original topic may have gotten lost in the shuffle: https://theeventscalendar.com/support/forums/topic/redirect-to-different-url-after-community-event-is-updated/

    Can someone please let me know how we can redirect a Community event that is updated by a user on the front-end (not in the admin)? This code from Casey is working great for new events, but it doesn’t redirect updated events:
    https://gist.github.com/caseypatrickdriscoll/8b4811d9010dd8d45a8f

    Redirecting an updated event to one url and new events to a different url would be ideal, although redirecting both new and updated events to the same url would still be better than no redirect for updated events 🙂

    Thank you,
    Sean

    #740266
    Barry
    Member

    Hi Sean,

    Apologies first of all for missing the original thread. You’re absolutely right -this did get lost in the shuffle and as it happened we just located your previous thread right before seeing this new one.

    I’ll close the older thread, and we can look at the problem here instead 🙂

    So right now you are testing to see if $wp->query_vars[WP_Router::QUERY_VAR] is set to ce-add-route – that’s not satisfied when an existing event is edited, though, so if you follow a similar approach and build on what you already have you would also need to test against the possibility that it might be set to ce-edit-route.

    I hope that helps 🙂

     

    #746774
    irishrunner16
    Participant

    Hi Barry,
    No worries on the original thread. I appreciate you pointing me in the right direction on this. I revised my function and was able to get the redirect working when an event is updated, but now the redirect is not working for newly submitted events (its just going to the default page that has “Event submitted. (View | Edit)” Any chance you could take a quick look to see what I’ve done wrong? http://pastebin.com/sbzPtsik

    #747037
    Barry
    Member

    Hi Sean,

    You’re correctly calling exit() after your wp_safe_redirect() call in the second clause (which is “listening” for event updates), but not in the first – but you need to ensure you exit after both.

    I hope that helps (and will go ahead and close this thread out  – as we’re really in custom development territory here) 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Redirect when Event is Updated’ is closed to new replies.