Created
June 25, 2025 15:26
-
-
Save audrasjb/019e342da2f7ed438867ba1083b38b2d to your computer and use it in GitHub Desktop.
Gravity Forms: Replace H2 with a paragraph in validation error main message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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