Last active
October 2, 2017 17:38
-
-
Save Shelob9/0202846fc63079db0748b7675ff33955 to your computer and use it in GitHub Desktop.
Change Caldera Forms field values using caldera_forms_entry_saved action. See: https://calderawp.com/doc/caldera_forms_entry_saved/
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( 'caldera_forms_entry_saved', function( $entryid, $new_entry, $form ){ | |
//get value of field with ID fld123456 | |
$value = Caldera_Forms::get_field_data( 'fld123456', $form, $entryid ); | |
//if value is a number and greater than 25 change field with ID fld42424242's value to "tacos" | |
if( is_numeric( $value ) && 25 < $value ){ | |
Caldera_Forms::set_field_data( 'fld42424242', 'tacos', $form, $entryid ); | |
} | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment