Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
Last active January 12, 2016 16:44
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 geoffgraham/80bd4483e94b44286ffe to your computer and use it in GitHub Desktop.
Save geoffgraham/80bd4483e94b44286ffe to your computer and use it in GitHub Desktop.
The Events Calendar 4.0.4 // Use full size thumbnail in Month View tooltip
if ( function_exists( 'tribe_is_event') ) {
/**
* Modifying the thumbnail arguments in Month view tooltip from a filter.
*
* @link https://theeventscalendar.com/support/forums/topic/month-view-tooltip-image-size/
* @return array
*/
function change_tribe_json_tooltip_thumbnail( $json ) {
$event_id = get_the_ID();
if ( ! empty( $json['imageTooltipSrc'] ) ) {
$thumb_id = get_post_thumbnail_id( $event_id );
$thumbnail_atts = wp_get_attachment_image_src( $thumb_id, 'full' );
$json['imageTooltipSrc'] = $thumbnail_atts[0];
}
return $json;
}
add_filter( 'tribe_events_template_data_array', 'change_tribe_json_tooltip_thumbnail' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment