Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save misfist/4b4d9a6b0dbf8b52e3a39cce8f2d3508 to your computer and use it in GitHub Desktop.
Save misfist/4b4d9a6b0dbf8b52e3a39cce8f2d3508 to your computer and use it in GitHub Desktop.
<?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;
});
<?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;
});
@misfist
Copy link
Author

misfist commented Oct 2, 2018

Corrected success message code originally posted here: https://calderaforms.com/doc/caldera_forms_render_notices/

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