Created
August 21, 2020 21:55
-
-
Save rafsuntaskin/bc1932f5c4748de420643c29e5ded5cd to your computer and use it in GitHub Desktop.
ET attendee report add Event Schedule
This file contains hidden or 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
<?php | |
add_action( 'init', 'rt_et_add_event_schedule_for_attendee_report', 99 ); | |
function rt_et_add_event_schedule_for_attendee_report() { | |
remove_action( 'tribe_tickets_attendees_event_details_list_top', [ | |
Tribe__Events__Event_Tickets__Main::instance()->attendees_report(), | |
'event_details_top', | |
] ); | |
} | |
add_action( 'tribe_tickets_attendees_event_details_list_top', function ( $event_id ) { | |
$post_type = get_post_type( $event_id ); | |
if ( Tribe__Events__Main::POSTTYPE === $post_type ) { | |
echo ' | |
<li> | |
<strong>' . esc_html__( 'Event Date:', 'the-events-calendar' ) . '</strong> | |
' . tribe_events_event_schedule_details( $event_id ) . ' | |
</li> | |
'; | |
} | |
if ( tribe_has_venue( $event_id ) ) { | |
$venue_id = tribe_get_venue_id( $event_id ); | |
/** | |
* Allows for control of the specific "edit post" URLs used for venue. | |
* | |
* @since 4.6.13 | |
* | |
* @param string $link The default "edit post" URL. | |
* @param int $venue_id The Post ID of the venue. | |
*/ | |
$edit_venue_link = apply_filters( 'tribe_tickets_venue_action_links_edit_url', get_edit_post_link( $venue_id ), $venue_id ); | |
echo ' | |
<li class="venue-name"> | |
<strong>' . tribe_get_venue_label_singular() . ': </strong> | |
<a href="' . esc_url( $edit_venue_link ) . '" title="' . esc_html__( 'Edit Venue', 'the-events-calendar' ) . '">' . tribe_get_venue( $event_id ) . '</a> | |
</li> | |
'; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment