Created
August 3, 2022 06:23
-
-
Save cryptexvinci/b0e12b2636e430062d5ad1c7539cf96c to your computer and use it in GitHub Desktop.
Revisions
-
cryptexvinci created this gist
Aug 3, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <?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; }