How would you display an image instead of a text for the category in the tooltip?
You can create a custom tag and display an image from each category
eg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Locate_And_Filter_Addon_Helper::define_custom_tags( array( 'category_image' =>'category_image'), 'all', getDataCallbackFn_locateanythingmarkercategory_image, 'category_image' ); function getDataCallbackFn_locateanythingmarkercategory_image( $field, $id){ $html = ''; ob_start(); ?> <div class="tags_wrap tooltip_tags"> <div class="cat_services tags_list"> <?php $cat_services = get_the_terms( $id, 'locateanythingmarkercategory' ); foreach ($cat_services as $key => $cat_service) { echo '<img class="tags_element '.$cat_service->slug.'" src="/'.$cat_service->slug.'.png">'; } ?> </div> </div> <?php $html .= ob_get_contents(); ob_end_clean(); return strval($html); } |