diff --git a/gp-nested-forms/gpnf-hide-empty-columns.php b/gp-nested-forms/gpnf-hide-empty-columns.php index 1efe9417f..a1dd85a65 100644 --- a/gp-nested-forms/gpnf-hide-empty-columns.php +++ b/gp-nested-forms/gpnf-hide-empty-columns.php @@ -163,8 +163,13 @@ function gpnfHecColumnHasValue( fieldId, entries ) { function gpnf_hec_column_has_value( $field_id, $entries ) { foreach ( $entries as $entry ) { - if ( rgar( $entry, $field_id ) ) { - return true; + foreach ( $entry as $key => $value ) { + // Match $field_id or subfield IDs (For fields like Name, Address, etc).) + if ( preg_match( '/^' . preg_quote( $field_id, '/' ) . '(\.\d+)?$/', $key ) ) { + if ( ! rgblank( $value ) ) { + return true; + } + } } } return false;