Skip to content

Commit 3c41658

Browse files
committed
gw-advanced-merge-tags.php: Added :selected modifier to target selected multi select choice by index on the Advanced Merge Tags snippet.
1 parent 0c8de01 commit 3c41658

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gravity-forms/gw-advanced-merge-tags.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ public function handle_field_modifiers( $value, $input_id, $modifier, $field, $r
493493
$default_countries = array_flip( GF_Fields::get( 'address' )->get_default_countries() );
494494
return rgar( $default_countries, $value );
495495
case 'selected':
496-
// 'selected' can be used over 'Checkbox' field to target the selected checkbox by its zero-based index.
497-
if ( $field->type == 'checkbox' ) {
496+
// 'selected' can be used over 'Checkbox' or 'Multi Select' field to target the selected checkbox/multiselect choice by its zero-based index.
497+
if ( $field->type == 'checkbox' || $field->type == 'multiselect' ) {
498498
$index = $modifier_options;
499499
if ( $index !== 'selected' && is_numeric( $index ) ) {
500500
$index = intval( $index );

0 commit comments

Comments
 (0)