Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active September 28, 2022 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/2983df2c8af2c9f6bafbd826a52dbc28 to your computer and use it in GitHub Desktop.
Save Pebblo/2983df2c8af2c9f6bafbd826a52dbc28 to your computer and use it in GitHub Desktop.
Example of how to add an events venues information into the calendars tooltips using the filter for the reg button HTML.
<?php //Do not include the opening PHP tag if you already have one.
add_filter(
'FHEE__EE_Calendar__get_calendar_events__tooltip_reg_btn_html',
'tw_ee_add_venue_info_before_reg_button',
10,
3
);
function tw_ee_add_venue_info_before_reg_button(
$tooltip_reg_btn_html,
$event,
$datetime
) {
$venue_html = '';
if($event instanceof EE_Event) {
$venues = $event->venues();
if(is_array($venues)) {
$venue = reset($venues);
if( $venue instanceof EE_Venue ){
$venue_html = '<p class="time_cal_qtip">';
$venue_html .= '<span>' . $venue->name() . '</span><br>';
$venue_html .= '<span>' . espresso_venue_raw_address('multiline', $venue->ID(), false) . '</span>';
$venue_html .= '</p>';
}
}
}
return $venue_html . $tooltip_reg_btn_html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment