Skip to content

Instantly share code, notes, and snippets.

@alanef
Last active January 30, 2023 21:09
Show Gist options
  • Select an option

  • Save alanef/c1e4f31bc7b940d551670d609cf69264 to your computer and use it in GitHub Desktop.

Select an option

Save alanef/c1e4f31bc7b940d551670d609cf69264 to your computer and use it in GitHub Desktop.
Custom Ranges for Display Eventbrite
<?php
/*
* Plugin Name: Custom Ranges for Display Eventbrite Events
* Plugin Description: This plugin allows you to set custom ranges for the Display Eventbrite Events plugin.
*/
/**
* Set the valid range for the list view.
*/
add_filter( 'wfea_cal_list_options' , function( $options ) {
$options['fullcalendar']['validRange'] = array(
'start' => date( 'Y-m-d', strtotime( '-5 months' ) ), // 5 months ago
'end' => date( 'Y-m-d', strtotime( '+5 months' ) ) // 5 months from now
);
return $options;
} );
/**
* Set the valid range for the calendar view.
*/
add_filter( 'wfea_cal_options' , function( $options ) {
$options['fullcalendar']['validRange'] = array(
'start' => date( 'Y-m-d', strtotime( '-5 months' ) ), // 5 months ago
'end' => date( 'Y-m-d', strtotime( '+5 months' ) ) // 5 months from now
);
return $options;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment