Skip to content

Instantly share code, notes, and snippets.

@danfisher85
Last active October 19, 2020 13:53
Show Gist options
  • Save danfisher85/728de943ce15be3cd57529d42d164dbc to your computer and use it in GitHub Desktop.
Save danfisher85/728de943ce15be3cd57529d42d164dbc to your computer and use it in GitHub Desktop.
adds 'buy ticket' link to [events_list] shortcode
function alc_event_list_add_ticket_th() {
echo '<th class="data-tickets">' . esc_html__( 'Tickets', 'sportspress' ) . '</th>';
}
add_action( 'sportspress_event_list_head_row', 'alc_event_list_add_ticket_th' );
function alc_event_list_add_ticket_td( $event ) {
echo '<td class="data-tickets" data-label="' . esc_attr__( 'Tickets', 'sportspress' ) . '">';
if ( 'future' == $event->post_status ) {
echo '<a href="#" class="btn btn-default btn-xs">' . esc_html__( 'Buy Ticket', 'sportspress' ) . '</a>';
}
echo '</td>';
}
add_action( 'sportspress_event_list_row', 'alc_event_list_add_ticket_td' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment