Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gw-all-fields-template.php: Fixed a fatal error with the snippet and Nested Forms. #751

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions gravity-forms/gw-all-fields-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Plugin URI: https://gravitywiz.com/gravity-forms-all-fields-template/
* Description: Modify the {all_fields} merge tag output via a template file.
* Author: Gravity Wiz
* Version: 0.10
* Version: 0.11
* Author URI: http://gravitywiz.com
*
* Usage:
Expand Down Expand Up @@ -175,6 +175,7 @@ public function all_fields_extra_options( $value, $merge_tag, $modifiers, $field
*/
if ( $context == 'nested' ) {

$input_ids = array();
saifsultanc marked this conversation as resolved.
Show resolved Hide resolved
$nested_form_field_id = rgar( $modifiers, 'parent', false );
if ( ! $nested_form_field_id ) {
break;
Expand All @@ -198,7 +199,7 @@ public function all_fields_extra_options( $value, $merge_tag, $modifiers, $field
case 'filter':
if ( in_array( $field->id, $field_ids ) ) {
// Check for input-specific filters.
if ( is_array( $raw_value ) && ! in_array( $field->id, $input_ids ) ) {
if ( is_array( $raw_value ) && ! empty( $input_ids ) && ! in_array( $field->id, $input_ids ) ) {
$filtered_values = array();

foreach ( $input_ids as $input_id ) {
Expand Down
Loading