Skip to content

Instantly share code, notes, and snippets.

@scyt
Created August 20, 2020 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scyt/24946f747648ae6738077d8bfc3b8265 to your computer and use it in GitHub Desktop.
Save scyt/24946f747648ae6738077d8bfc3b8265 to your computer and use it in GitHub Desktop.
<?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