Created
May 17, 2014 21:19
-
-
Save thomasgriffin/62ab0d09ca28d3e6fc7e to your computer and use it in GitHub Desktop.
Add email and name as query args to the success redirect page in OptinMonster.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'optin_monster_conversion_data', 'tgm_om_modify_conversion_data', 10, 2 ); | |
function tgm_om_modify_conversion_data( $data, $object ) { | |
// If there is no redirect, do nothing. | |
if ( empty( $data['redirect'] ) ) { | |
return $data; | |
} | |
if ( isset( $object->email ) && $object->email ) { | |
$data['redirect'] = add_query_arg( 'email', $object->email, $data['redirect'] ); | |
} | |
if ( isset( $object->name ) && $object->name ) { | |
$data['redirect'] = add_query_arg( 'name', $object->name, $data['redirect'] ); | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment