Forked from Shelob9/caldera_forms_render_notices-customize-error-notice.php
Last active
October 2, 2018 00:06
-
-
Save misfist/4b4d9a6b0dbf8b52e3a39cce8f2d3508 to your computer and use it in GitHub Desktop.
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 | |
//Change error message of AJAX submitted form. | |
add_filter( 'caldera_forms_render_notices', function( $notices ){ | |
//Will NOT be set (during AJAX return) if there is no error | |
if( isset( $notices[ 'error' ], $notices[ 'error' ][ 'note' ] ) ){ | |
$notices[ 'error' ][ 'note' ] = 'Form could not be submitted, please correct erorrs or give us a call.'; | |
} | |
return $notices; | |
}); | |
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 | |
//Change success message of AJAX submitted form. | |
add_filter( 'caldera_forms_render_notices', function( $notices ){ | |
if( isset( $notices[ 'success' ], $notices[ 'success' ][ 'note' ] ) ){ | |
$notices[ 'success' ][ 'note' ] = 'That was awesome!'; | |
} | |
return $notices; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Corrected success message code originally posted here: https://calderaforms.com/doc/caldera_forms_render_notices/