Created
August 3, 2022 06:23
-
-
Save cryptexvinci/b0e12b2636e430062d5ad1c7539cf96c to your computer and use it in GitHub Desktop.
Ultimate Member - Display checkbox output in columns
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( "um_view_field_value_checkbox", "my_um_view_field_value_checkbox", 10, 2 ); | |
function my_um_view_field_value_checkbox( $html, $data ) { | |
if ( $data['metakey'] != 'your_checkbox_meta_key' ) { | |
return $html; | |
} | |
$html = um_filtered_value( $data['metakey'], $data ); | |
$html_array = explode( ',', $html ); | |
$html_array = array_map( 'trim', $html_array ); | |
$html = '<ul></ul>'; | |
foreach ( $html_array as $item ) { | |
$html .= '<li>' . $item . '</li>'; | |
} | |
$html .= '</ul>'; | |
return $html; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment