Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active January 24, 2024 22:34
Show Gist options
  • Select an option

  • Save Shelob9/4015f6489ee94e6ee743db4f359f14d4 to your computer and use it in GitHub Desktop.

Select an option

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);
@Shelob9

Shelob9 commented May 11, 2018

Copy link
Copy Markdown
Author

Changes required to use this code on your site:

  • Change the form ID on line 8 to your form's ID. 'CF111'
  • Change the field ID on line 10 to your field ID. 'fl1345'
  • Change the prefix on line 15. 'PX-'

@Lmobilegroup

Copy link
Copy Markdown

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