Last active
October 1, 2024 21:20
-
-
Save rafaehlers/9a1efe31bb5e7db3d518a71420a12093 to your computer and use it in GitHub Desktop.
:explode merge tag modifier for use on GravityCalendar event titles
This file contains hidden or 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 // 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