MT - TEC PRO - Modify Map View's Tooltips Data
<?php
/**
* MT - TEC PRO - Modify Map View's Tooltips Data
*
* from https://gist.github.com/cliffordp/0a7381fb1dfadd8e68644ce40ba9cc50
* as-is screenshot: https://cl.ly/2h3E3k1r3R1r
*
* Would need to add custom JavaScript, possibly via tribe_ev.map_add_marker() and others from /wp-content/plugins/events-calendar-pro/src/resources/js/tribe-events-ajax-maps.js in order to ADD additional lines of output instead of just MODIFYING one of the existing lines.
*
* for https://theeventscalendar.com/support/forums/topic/map-view-tooltip-customization/
*
* @param array $response
*
* @return array
*/
function cliff_tec_pro_map_marker_info( $response ) {
if ( ! is_array( $response ) || 'map' !== $response['view'] ) {
return $response;
}
foreach ( $response['markers'] as $key => $value ) {
$response['markers'][ $key ]['address'] .= ' -- My Custom Text Here.';
}
return $response;
}
add_filter( 'tribe_events_ajax_response', 'cliff_tec_pro_map_marker_info' );