Created
August 20, 2020 16:26
-
-
Save scyt/24946f747648ae6738077d8bfc3b8265 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 | |
/** | |
* Gravity Perks // GP Nested Forms // Reorder Nested Form Field Columns | |
* | |
* Reorder the columns in the Nested Form Field summary table. | |
* | |
* @version 0.1 | |
* @author David Smith <david@gravitywiz.com> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
// Update "123" to the ID of your form. | |
add_filter( 'gform_form_post_get_meta_123', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// Update "4" to the ID of your Nested Form field. | |
if( $field->id == 4 ) { | |
// Update "5", "6" and "7" to the desired field IDs from your child form. | |
$field->gpnfFields = array( 7, 5, 6 ); | |
} | |
} | |
return $form; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment