Tribe__Events__Community__Tickets__Main::report_links( WP_Post $post )

Hooked to the tribe_events_community_event_list_table_row_actions action to add navigation for reports.


Parameters #

$post

(WP_Post) (Required) Post object.


Top ↑

Source #

File: src/Tribe/Main.php

	public function report_links( $post ) {
		if ( ! current_user_can( 'edit_event_tickets' ) ) {
			return;
		}

		if ( ! tribe_events_has_tickets( $post ) ) {
			return;
		}

		/**
		 * Allow filtering of attendees button text on the event list.
		 *
		 * @since 3.12
		 *
		 * @param string $attendees_button_text Current translated button text.
		 */
		$attendees_button_text = apply_filters( $this->hook_prefix . 'event-list-attendees-button-text', __( 'Attendees', 'tribe-events-community-tickets' ) );

		/**
		 * Allow filtering of sales button text on the event list.
		 *
		 * @since 3.12
		 *
		 * @param string $sales_button_text Current translated button text.
		 */
		$sales_button_text = apply_filters( $this->hook_prefix . 'event-list-sales-button-text', __( 'Sales', 'tribe-events-community-tickets' ) );
		?>
		<br/>
		<strong><?php echo esc_html__( 'Reports:', 'tribe-events-community-tickets' ); ?></strong>
		<a class="tribe-attendee-report" href="<?php echo esc_url( $this->routes['attendees-report']->url( $post->ID ) ); ?>">
			<?php echo esc_html( $attendees_button_text ); ?>
		</a> | <a class="tribe-sales-report" href="<?php echo esc_url( $this->routes['sales-report']->url( $post->ID ) ); ?>">
			<?php echo esc_html( $sales_button_text ); ?>
		</a>
		<?php
	}