Created
February 7, 2022 18:31
-
-
Save erickarbe/b6345a979665175e99e32348d0378155 to your computer and use it in GitHub Desktop.
add netlify tags to gravity forms
This file contains 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
//Add Netflify tag to GForms | |
add_filter( 'gform_form_tag', 'form_tag_netlify', 10, 2 ); | |
function form_tag_netlify( $form_tag, $form ) { | |
$form_name = $form['title']; | |
$form_tag = str_replace( "<form ", "<form name='{$form_name}' data-netlify='true' action='/pages/success' ", $form_tag ); | |
return $form_tag; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment