Created
August 19, 2014 00:10
-
-
Save spivurno/82a4535eb0fba075520c to your computer and use it in GitHub Desktop.
Gravity Wiz // Gravity Forms // Add Spaces for Multi Select Merge Tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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