| @@ -8,9 +8,9 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | class FrmEntryValues { |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | - * @var stdClass|null | |
| 12 | + * @var false|stdClass|null | |
| 13 | 13 | */ |
| 14 | 14 | protected $entry; |
| 15 | 15 | |
| 16 | 16 | /** |
| @@ -116,11 +116,9 @@ | ||
| 116 | 116 | */ |
| 117 | 117 | protected function init_include_fields( $atts ) { |
| 118 | 118 | // For reverse compatibility with the fields parameter. |
| 119 | 119 | if ( empty( $atts['include_fields'] ) && ! empty( $atts['fields'] ) ) { |
| 120 | - if ( ! is_array( $atts['fields'] ) ) { | |
| 121 | - $atts['include_fields'] = $atts['fields']; | |
| 122 | - } else { | |
| 120 | + if ( is_array( $atts['fields'] ) ) { | |
| 123 | 121 | $atts['include_fields'] = ''; |
| 124 | 122 | |
| 125 | 123 | foreach ( $atts['fields'] as $included_field ) { |
| 126 | 124 | $atts['include_fields'] .= $included_field->id . ','; |
| @@ -126,8 +124,10 @@ | ||
| 126 | 124 | $atts['include_fields'] .= $included_field->id . ','; |
| 127 | 125 | } |
| 128 | 126 | |
| 129 | 127 | $atts['include_fields'] = rtrim( $atts['include_fields'], ',' ); |
| 128 | + } else { | |
| 129 | + $atts['include_fields'] = $atts['fields']; | |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | $this->include_fields = $this->prepare_array_property( 'include_fields', $atts ); |
| @@ -308,13 +308,13 @@ | ||
| 308 | 308 | */ |
| 309 | 309 | protected function is_field_included( $field ) { |
| 310 | 310 | $is_included = true; |
| 311 | 311 | |
| 312 | - if ( ! empty( $this->include_fields ) ) { | |
| 312 | + if ( $this->include_fields ) { | |
| 313 | 313 | $is_included = $this->is_field_in_array( $field, $this->include_fields ); |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - if ( ! empty( $this->exclude_fields ) ) { | |
| 316 | + if ( $this->exclude_fields ) { | |
| 317 | 317 | $is_excluded = $this->is_field_in_array( $field, $this->exclude_fields ); |
| 318 | 318 | |
| 319 | 319 | if ( $is_excluded ) { |
| 320 | 320 | $is_included = false; |