Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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