Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elimn/ffa84662d26faadb906dc5aea2a0896b to your computer and use it in GitHub Desktop.
Save elimn/ffa84662d26faadb906dc5aea2a0896b to your computer and use it in GitHub Desktop.
MT | ETP | When an RSVP is submitted succesfully redirect users to a new page
<?php
/*
* When an RSVP is submitted succesfully redirect users to a new page
*/
function tribe_event_tickets_rsvp_success_script() {
if( ! isset($_GET['rsvp_sent']) || $_GET['rsvp_sent'] != 1 ) return;
// Change this to URL that you want users redirected to
// Include the full URL, so start with http://
$redirect_url = 'http://example.com';
echo '<script>document.location.href = "' . $redirect_url .'";</script>';
}
add_action( 'wp_head', 'tribe_event_tickets_rsvp_success_script' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment