Skip to content

Instantly share code, notes, and snippets.

@danfisher85
Created November 9, 2019 11:51
Show Gist options
  • Save danfisher85/61e69acb4ed3a399c001e947e0ee8627 to your computer and use it in GitHub Desktop.
Save danfisher85/61e69acb4ed3a399c001e947e0ee8627 to your computer and use it in GitHub Desktop.
Adds 'buy ticket' link to [events_blocks] shortcode (after v3.4.1 update)
function alc_event_blocks_add_ticket( $event ) {
echo '<div class="widget-game-result__tickets">';
if ( 'future' == $event->post_status ) {
echo '<a href="#" class="btn btn-default btn-xs">' . esc_html__( 'Buy Ticket', 'sportspress' ) . '</a>';
}
echo '</div>';
}
add_action( 'sportspress_event_blocks_row', 'alc_event_blocks_add_ticket' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment