Last active
October 19, 2020 13:53
-
-
Save danfisher85/728de943ce15be3cd57529d42d164dbc to your computer and use it in GitHub Desktop.
adds 'buy ticket' link to [events_list] shortcode
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
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