Skip to content

Instantly share code, notes, and snippets.

@mattboon
Created April 19, 2012 14:55
Show Gist options
  • Save mattboon/2421469 to your computer and use it in GitHub Desktop.
Save mattboon/2421469 to your computer and use it in GitHub Desktop.
WordPress - Gravity forms snippets
<?php
// Anchor when erroring
add_filter("gform_confirmation_anchor", create_function("","return true;"));
// Error message
add_filter("gform_validation_message", "change_message", 10, 2);
function change_message($message, $form){
//return "Failed Validation - " . $form["title"];
return "<strong class=\"message error\">Please complete the required fields and try again</strong>";
}
// Change to button element
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
return "<button class='submit' id='gform_submit_button_{$form["id"]}'><span>Send your enquiry</span></button>";
}
?>
@devhelper
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment