Last active
October 12, 2021 07:26
-
-
Save ash-f/4b6678ee992f5d040f749481fd46b3ce to your computer and use it in GitHub Desktop.
WP Fluent Forms checkbox key-value swapping filter
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
add_filter('fluentform_response_render_input_checkbox', function ($value, $field, $formId, $isHtml) { | |
if ( $formId === 3 ) { | |
$value=''; | |
foreach ( $field['raw']['settings']['advanced_options'] as $fv ) { | |
$value .= '<li>' . $fv['value'] . '</li>'; | |
} | |
if( $value !== '' ){ | |
$value = '<ul style="white-space: normal;">' . $value . '</ul>'; | |
} | |
} | |
return $value; | |
}, 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment