Created
April 26, 2016 15:32
-
-
Save spivurno/b7d131ce96026f4eac9d104e71e35a67 to your computer and use it in GitHub Desktop.
Gravity Perks // GP Nested Forms // Populate Nested Form Field
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 | |
/** | |
* 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