Tribe__Events__Community__Tickets__Shortcodes::attendees_buttons( $event_id = '' )

Override the default Print, Email and Export buttons on Attendees table.

Enable the "Export CSV files" feature on attendee reports


Parameters

$event_id

(Optional)

Default value: ''


Top ↑

Return

(array)


Top ↑

Source

File: src/Tribe/Shortcodes.php

	public function attendees_buttons( $event_id = '' ) {

		if ( ! empty( $event_id ) ) {
			$post_object = get_post( absint( $_GET['event_id'] ) );

			if ( isset( $post_object->ID ) ) {
				$event_id = $post_object->ID;
			}
		}
		$main = tribe( 'community.main' );

		$community_slug = $main->getCommunityRewriteSlug();
		$attendees_slug = $main->rewriteSlugs['attendees'];
		$event_slug     = $main->rewriteSlugs['event'];

		$url = esc_url( home_url() . '/' . $community_slug . '/' . $attendees_slug . '/' . $event_slug . '/' . $event_id );

		$export_url = add_query_arg( array(
			'attendees_csv'       => true,
			'attendees_csv_nonce' => wp_create_nonce( 'attendees_csv_nonce' ),
		), esc_url( $url ) );

		$email_link = Tribe__Settings::instance()->get_url( array(
			'page'      => 'tickets-attendees',
			'action'    => 'email',
			'event_id'  => $event_id,
			'TB_iframe' => true,
			'width'     => 410,
			'height'    => 300,
			'parent'    => 'admin.php',
		) );

		$nav = array(
			'left'  => array(
				'print'  => sprintf( '<input type="button" name="print" class="print button action" value="%s">', esc_attr__( 'Print', 'event-tickets' ) ),
				'email'  => sprintf( '<a class="email button action thickbox" href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html__( 'Email', 'event-tickets' ) ),
				'export' => sprintf( '<a target="_blank" href="%1$s" class="export button action">%2$s</a>', esc_url( $export_url ), esc_html__( 'Export', 'event-tickets' ) ),
			),
			'right' => array(),
		);

		return $nav;
	}

Top ↑

Changelog

Changelog
Version Description
4.6.2 Introduced.