Created
March 20, 2020 11:43
-
-
Save New0/e210cc9f661154c02dda08feb623eeba to your computer and use it in GitHub Desktop.
Print data from the Caldera Forms submission the the render notice
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 | |
/** | |
* Plugin Name: CF Render Notice data | |
* Description: Filter Caldera Forms render notice data and use data from the form submission. | |
* Author: New0 Nico Figueira | |
*/ | |
add_filter( 'caldera_forms_render_notices', function( $notices ){ | |
//Set the correct corresponding field ID we want the data from/ | |
$name_field_id = 'fld_8768091'; | |
//Explore $notices to print the correct data depending on the state of Form Submission. | |
if( isset( $notices[ 'success' ], $_POST[$name_field_id] ) ){ | |
$notices[ 'success' ]['note'] = __('Thank you ', 'caldera-forms') . $_POST[$name_field_id]; | |
} | |
return $notices; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment