Skip to content

Instantly share code, notes, and snippets.

@New0
Created March 20, 2020 11:43
Show Gist options
  • Save New0/e210cc9f661154c02dda08feb623eeba to your computer and use it in GitHub Desktop.
Save New0/e210cc9f661154c02dda08feb623eeba to your computer and use it in GitHub Desktop.
Print data from the Caldera Forms submission the the render notice
<?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