Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/82a4535eb0fba075520c to your computer and use it in GitHub Desktop.
Save spivurno/82a4535eb0fba075520c to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Add Spaces for Multi Select Merge Tag
<?php
add_filter( 'gform_merge_tag_filter', 'gw_add_spaces_for_multi_select_merge_tag', 10, 5 );
function gw_add_spaces_for_multi_select_merge_tag( $value, $merge_tag, $options, $field, $raw_value ) {
if( GFFormsModel::get_input_type( $field ) == 'multiselect' && $merge_tag == $field['id'] ) {
$value = implode( ', ', explode( ',', $value ) );
}
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment