Skip to content

Instantly share code, notes, and snippets.

@erickarbe
Created February 7, 2022 18:31
Show Gist options
  • Save erickarbe/b6345a979665175e99e32348d0378155 to your computer and use it in GitHub Desktop.
Save erickarbe/b6345a979665175e99e32348d0378155 to your computer and use it in GitHub Desktop.
add netlify tags to gravity forms
//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