/**
* Adds form title to a data attribute on the form element
* @param [string] $form_tag The string containing the <form> tag
* @param [object] $form The current form
* @return [string] The new <form> tag string
*/
function gravity_form_tag($form_tag, $form) {
$form_title = $form['title'];
$form_tag = str_replace('<form', "<form data-formtitle='{$form_title}'", $form_tag);
return $form_tag;
}
add_filter('gform_form_tag', 'gravity_form_tag', 10, 2);