Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per processor based error message #3641

Open
mmattel opened this issue Nov 26, 2020 · 0 comments
Open

Per processor based error message #3641

mmattel opened this issue Nov 26, 2020 · 0 comments

Comments

@mmattel
Copy link

mmattel commented Nov 26, 2020

Do You Need Immediate Help?

  • no

Is This A Feature Request?

  • depends

What Version Of Caldera Forms, WordPress and PHP Are You Using?

  • CF: 1.9.2, WP: 5.5.3, PHP: 7.3

Does Your Issue Persist When You Disable All Other Plugins and Switch To The Default Theme?

  • Not relevant

Following problem:

I am programming a processor and want to customize the success message for exactly this processor only (in the same way am am able to customize the error message). I do not want to touch the default message. But whatever I do this does not work.

//Change error message of AJAX submitted form.
add_filter( 'caldera_forms_render_notices', function( $notices ) {
	if( isset( $notices[ 'error' ], $notices[ 'error' ][ 'success' ] ) ) {
		$notices[ 'error' ][ 'success' ] = 'This worked great';
	}
	return $notices;
});

It does not matter if I put this filter into my plugin root or into the main function of it, It never triggers.

Question:
What is the correct approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant