Last active
December 12, 2024 18:54
-
-
Save yuriinalivaiko/c6d4f651b53f3c37b8591014b7e1e3af to your computer and use it in GitHub Desktop.
Display all form errors below the form in Ultimate Member.
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
| /** | |
| * Hide error messages under fields. | |
| */ | |
| .um-field .um-field-error { | |
| display: none; | |
| } |
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 | |
| /** | |
| * Display all form errors below the form. | |
| */ | |
| add_action( 'um_after_form', function () { | |
| if ( ! empty( UM()->form()->errors ) ) { | |
| foreach ( UM()->form()->errors as $key => $error_text ) { | |
| echo UM()->fields()->field_error( $error_text, $key ); | |
| } | |
| } | |
| } ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected result

This gist is a part of the article Display all form errors below the form.
Use this solution if you prefer displaying errors in popup: https://gist.github.com/yuriinalivaiko/3979f4fb19bf42929d1043b257ff5e28