Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save audrasjb/019e342da2f7ed438867ba1083b38b2d to your computer and use it in GitHub Desktop.

Select an option

Save audrasjb/019e342da2f7ed438867ba1083b38b2d to your computer and use it in GitHub Desktop.
Gravity Forms: Replace H2 with a paragraph in validation error main message.
<?php
/**
* Changes default error markup after form validation.
* This especially replaces H2 tag with P.
*/
function jba_change_error_message( $message, $form ) {
return '<p class="gform_submission_error hide_summary">' .
'<span class="gform-icon gform-icon--close"></span>' .
esc_html__( 'There was a problem with your submission.', 'gravityforms' ) .
'</p>';
}
add_filter( 'gform_validation_message', 'jba_change_error_message', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment