Created
January 25, 2024 23:40
-
-
Save mishterk/33d089ca5e299146f88471768a711df6 to your computer and use it in GitHub Desktop.
This file contains 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 | |
add_action( 'af/form/submission', function ( $form, $args ) { | |
// Append a custom value to the submission array | |
AF()->submission['some_extra_data'] = 'some value here'; | |
}, 10, 2 ); | |
add_filter( 'af/form/success_message', function ( $success_message, $form, $args ) { | |
// Use the custom value to determine the success message | |
if ( AF()->submission['some_extra_data'] === 'some value here' ) { | |
$success_message = 'This is a custom success message'; | |
} | |
return $success_message; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment