Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Last active October 1, 2024 21:20
Show Gist options
  • Save rafaehlers/9a1efe31bb5e7db3d518a71420a12093 to your computer and use it in GitHub Desktop.
Save rafaehlers/9a1efe31bb5e7db3d518a71420a12093 to your computer and use it in GitHub Desktop.
:explode merge tag modifier for use on GravityCalendar event titles
<?php // DO NOT COPY THIS LINE
add_filter( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value ) {
if( 'all_fields' !== $merge_tag && 'explode' === $modifier ) {
$choices = explode(',', $value);
foreach ($choices as $key => $choice) {
$output .= $choice.'<br>';
}
return $output;
}
return $value;
}, 10, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment