Created
April 25, 2023 11:49
-
-
Save matty0501/3938aaa87b09b823aa30a5ee3f24ef30 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Save field in uppercase when form is submitted | |
*/ | |
add_action( 'gform_pre_submission_123', 'gw_capitalize_submitted_data' ); // Replace 123 with your form ID | |
function gw_capitalize_submitted_data( $form ) { | |
$input_key = sprintf( 'input_%s', 1 ); // Replace 1 with your field ID | |
$_POST[ $input_key ] = strtoupper( rgpost( $input_key ) ); | |
return $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment