Created
February 6, 2019 08:00
-
-
Save spivurno/52143c17549bd5f35e01153fea7ec023 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 // Nested Forms // Re-order Display Fields | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
// Update "123" to your form ID. | |
add_filter( 'gform_pre_render_123', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// Update "2" to your Nested Form field ID. | |
if( $field->id = 2 ) { | |
// Update "1, 2, 3" to the field IDs from your child form and put them in the desired order. | |
$field->gpnfFields = array( 1, 2, 3 ); | |
} | |
} | |
return $form; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment