Skip to content

Instantly share code, notes, and snippets.

@cryptexvinci
Created August 3, 2022 06:23
Show Gist options
  • Save cryptexvinci/b0e12b2636e430062d5ad1c7539cf96c to your computer and use it in GitHub Desktop.
Save cryptexvinci/b0e12b2636e430062d5ad1c7539cf96c to your computer and use it in GitHub Desktop.
Ultimate Member - Display checkbox output in columns
<?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