Last active
January 12, 2016 16:44
-
-
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
This file contains 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 characters
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