Help Desk

Redirect to Different URL After Community Event Submission

  • Posts: 36 Topics: 15
    | Permalink

    Hey amazing people of the modern tribe!
    (sure casey will be the guy who answers)
    ive been looking at changing my events submission form completion message, which after reading on the forms at present isnt possible;
    (https://tri.be/support/forums/topic/changing-event-submission-message/)
    so i took the other direction of doing a redirect.
    following the instructions and adding this snipet;
    https://theeventscalendar.com/redirect-to-different-url-after-community-event-submission/
    it works great. [event submission > redirects to home page]
    BUUUUUT, I want to redirect to a different page that ive created rather than the home page….
    ive tried a few different ways of putting in my custom url;
    wp_safe_redirect(page_url(/bookings/booking-completed));
    exit();
    wp_safe_redirect(url(/bookings/booking-completed));
    exit();
    wp_safe_redirect((/bookings/booking-completed));
    exit();
    none seem to allow the redirect…
    am i doing something wrong? should i be using a different trigger?
    or is what i want not possible and the redirect using this snipet will only be able to redirect to the home page?

    Thanks in advance Casey 🙂

    Posts: 3519 Answers: 115
    | Permalink
    Correct Answer

    astcit,
    You’ll need to put the entire URL there, and include it in single quotes. Something like this should work:

    wp_safe_redirect( home_url() . '/bookings/booking-completed/' );
    

    Give that a try. Thanks! 🙂

    -Casey-

    Posts: 36 Topics: 15
    | Permalink

    wicked cool! thanks for that Casey!
    i couldn’t work it out for the life of me!
    appreciate your work as always mate.
    review coming soon 😉

    Posts: 3519 Answers: 115
    | Permalink

    Glad that did the trick! Since you’re all set, I’ll go ahead and close out this thread. Thanks! 🙂

    -Casey-