Skip to content

Instantly share code, notes, and snippets.

@New0
Last active March 15, 2022 08:05
Show Gist options
  • Save New0/c27d8f253ddfbc4ce612b8fd67a0c44c to your computer and use it in GitHub Desktop.
Save New0/c27d8f253ddfbc4ce612b8fd67a0c44c to your computer and use it in GitHub Desktop.
Caldera Forms redirection processor using window.location to open a new window
<?php
/**
* Plugin Name: CF custom redirection
* Description: Customization for the Caldera Forms redirect processor.
* Version: 0.0.1
* Author: New0
* Author URI: https://github.com/New0
*/
add_action('caldera_forms_redirect', function($type, $url, $form){
//CHANGE TO MATCH THE FORM IF
if( $form['ID'] === 'CF5a95cf4caa782' && $type === 'complete' ){
?><script type="text/javascript">window.open('<?php echo $url ?>')</script><?php
exit;
}
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment