Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spivurno/b7d131ce96026f4eac9d104e71e35a67 to your computer and use it in GitHub Desktop.
Save spivurno/b7d131ce96026f4eac9d104e71e35a67 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Nested Forms // Populate Nested Form Field
<?php
/**
* Gravity Perks // GP Nested Forms // Populate Nested Form Field
*/
add_action( 'gform_enqueue_scripts', function( $form ) {
if( $form['id'] == 508 ) {
foreach( $form['fields'] as $field ) {
if ( $field->id == 2 ) {
$_POST["input_{$field->id}"] = '7631,7629';
}
}
}
}, 9 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment