Home › Forums › Calendar Products › Events Calendar PRO › Redirect when Event is Updated
- This topic has 3 replies, 2 voices, and was last updated 9 years, 7 months ago by Barry.
-
AuthorPosts
-
September 12, 2014 at 7:52 am #739990irishrunner16Participant
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/8b4811d9010dd8d45a8fRedirecting 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,
SeanSeptember 12, 2014 at 10:19 am #740266BarryMemberHi 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 🙂
September 16, 2014 at 12:53 pm #746774irishrunner16ParticipantHi 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/sbzPtsikSeptember 16, 2014 at 2:06 pm #747037BarryMemberHi 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) 🙂
-
AuthorPosts
- The topic ‘Redirect when Event is Updated’ is closed to new replies.