Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active January 24, 2024 22:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/4015f6489ee94e6ee743db4f359f14d4 to your computer and use it in GitHub Desktop.
Save Shelob9/4015f6489ee94e6ee743db4f359f14d4 to your computer and use it in GitHub Desktop.
Change field value for field set by Caldera Forms incremental value processor using the caldera_forms_submit_complete action See: https://calderaforms.com/doc/caldera_forms_submit_complete/
<?php
/**
* Change field value for field set by Caldera Forms incremental value processor
*/
add_action( 'caldera_forms_submit_complete',function( $form, $referrer, $process_id, $entryid ){
//change form ID to match your form
if( 'CF111' === $form[ 'ID' ] ){
//change field to match field used with processor
$field_id = 'fl1345';
//get saved field value
$value = Caldera_Forms::get_field_data( $field_id, $form, $entryid );
if( $value ){
//change and save
$value = 'PX-' . $value;
Caldera_Forms::set_field_data( $field_id, $value, $form, $entryid );
}
}
}, 5, 4);
@Lmobilegroup
Copy link

Dear Josh

code works fine to change prefix on generated summary for email automatic entry email. But in autoresponder and copy of email still the numeric count is send. We used LM-30-144 (works on entry email) autoresponder shows 144.

Any idea to fix that? Best regards Marc

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