Skip to content

Instantly share code, notes, and snippets.

@vicskf
Last active February 23, 2017 06:26
Show Gist options
  • Save vicskf/937e9e0e9324c857b6df623e3ebe979e to your computer and use it in GitHub Desktop.
Save vicskf/937e9e0e9324c857b6df623e3ebe979e to your computer and use it in GitHub Desktop.
<?php
/*
* Adds the placeholder {thumbnail:linked} for the shortcode [tribe_event_inline]
* To be used as a new variable that outputs the thumbnail with a link to the event
*
* Author: Barry Hughes
*/
function do_linked_thumb_placeholder( $event_id ) {
return '<a href="' . get_permalink( $event_id ) . '">' . tribe_event_featured_image( $event_id, 'full', false ) . '</a>';
}
function register_inline_linked_thumb_tag( array $placeholders ) {
$placeholders['{thumbnail:linked}'] = 'do_linked_thumb_placeholder';
return $placeholders;
}
add_filter( 'tribe_events_pro_inline_placeholders', 'register_inline_linked_thumb_tag' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment