Home / Admin / Remove Unwanted Events | Display Eventbrite Events
Duplicate Snippet

Embed Snippet on Your Site

Remove Unwanted Events | Display Eventbrite Events

Sometimes it is simplest to resort to code if you want to remove something from the results set. The following example removes a specific organizer id from the results.

(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_api_results', function ( $events ) {
	// remove a specific organiser id
	$organiser_id = 123456789;
	$events       = array_filter( $events, function ( $event ) use ( $organiser_id ) {
		return $event->organizer->id != $organiser_id;
	} );
	return $events;
},
	1000,
	1 );

Comments

Add a Comment