i am using gravity form and i want to open my redirect confirmation page in new tab
Here is code which given by Gravity form doc
add_filter( 'gform_confirmation', function ( $confirmation, $form, $entry, $ajax ) {
GFCommon::log_debug( __METHOD__ . '(): running.' );
if ( isset( $confirmation['redirect'] ) ) {
$url = esc_url_raw( $confirmation['redirect'] );
GFCommon::log_debug( __METHOD__ . '(): Redirect to URL: ' . $url );
$confirmation = 'Thanks for contacting us! We will get in touch with you shortly.';
$confirmation .= "<script type=\"text/javascript\">window.open('$url', '_blank');</script>";
}
return $confirmation;
}, 10, 4 );
Link: https://docs.gravityforms.com/gform_confirmation/#4-open-the-page-or-redirect-in-a-new-tab
i paste the above code in my child theme function file but it's not working can someone plz help me to fix this.
Here is code which given by Gravity form doc
add_filter( 'gform_confirmation', function ( $confirmation, $form, $entry, $ajax ) {
GFCommon::log_debug( __METHOD__ . '(): running.' );
if ( isset( $confirmation['redirect'] ) ) {
$url = esc_url_raw( $confirmation['redirect'] );
GFCommon::log_debug( __METHOD__ . '(): Redirect to URL: ' . $url );
$confirmation = 'Thanks for contacting us! We will get in touch with you shortly.';
$confirmation .= "<script type=\"text/javascript\">window.open('$url', '_blank');</script>";
}
return $confirmation;
}, 10, 4 );
Link: https://docs.gravityforms.com/gform_confirmation/#4-open-the-page-or-redirect-in-a-new-tab
i paste the above code in my child theme function file but it's not working can someone plz help me to fix this.
Last edited: