diff --git a/gp-entry-blocks/gpeb-use-select-for-country-filter.php b/gp-entry-blocks/gpeb-use-select-for-country-filter.php new file mode 100644 index 000000000..adf9dfd47 --- /dev/null +++ b/gp-entry-blocks/gpeb-use-select-for-country-filter.php @@ -0,0 +1,52 @@ + $country, + 'value' => $country, + ); + }, $field['gpebFilterInputField']->get_countries() ); + + // Change the field to a select and populate it with countries from the address field. + $new_field = new \GF_Field_Select( array( + 'id' => $field['id'], + 'label' => $field['label'], + 'gpebFilterSearch' => $field['gpebFilterSearch'], + 'gpebFilterInputField' => $field['gpebFilterInputField'], + 'size' => $field['size'], + 'inputs' => $field['inputs'], + 'formId' => $field['formId'], + 'type' => 'select', + 'choices' => $country_choices, + ) ); + return $new_field; + } + + return $field; +} );