Skip to content

Instantly share code, notes, and snippets.

@DeveloperWil
Created June 23, 2015 07:27
Show Gist options
  • Select an option

  • Save DeveloperWil/256750bd84b063a4bfc8 to your computer and use it in GitHub Desktop.

Select an option

Save DeveloperWil/256750bd84b063a4bfc8 to your computer and use it in GitHub Desktop.
Gravity Forms change < input type=submit > form elements to <button>
/**
* Change GF input type=submit to HTML 5 <button>
*
* @param $button
* @param $form
* @return mixed|string
*/
function lc_gf_form_submit_button ( $button, $form ){
$button = str_replace( "input", "button", $button );
$button = str_replace( "/", "", $button );
$button .= "{$form['button']['text']}</button>";
return $button;
}
add_filter( 'gform_submit_button', 'lc_gf_form_submit_button', 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment