Home / Admin / Event URL (Additional Data) | Display Eventbrite Events
Duplicate Snippet

Embed Snippet on Your Site

Event URL (Additional Data) | Display Eventbrite Events

This filter allows you to adjust the event URL. This is primarily so you can add tracking information to your link – see https://www.eventbrite.com/support/articles/en_US/How_To/how-to-create-promotional-tracking-links?lg=en_GB

With the below filter you can apply logic based on additional data.

(Note this code snippet applies for "Display Eventbrite Events Plugin" available here: https://fullworksplugins.com/products/widget-for-eventbrite/ )

Code Preview
php
<?php
add_filter( 'wfea_event_url', function ( $url, $event_id, $organizer, $venue, $category ) {
	$code = 'online';
	if ( property_exists( $venue, 'id' ) ) {
		switch ( $venue->id ) {
			case 12345:
				$code = 'venue1';
				break;
			case 999893:
				$code = 'venue2';
				break;
			default:
				$code = 'general';
		}
	}
	return $url . '?aff=' . $code;
}, 10, 5 );

Comments

Add a Comment