Last active
January 30, 2023 21:09
-
-
Save alanef/c1e4f31bc7b940d551670d609cf69264 to your computer and use it in GitHub Desktop.
Custom Ranges for Display Eventbrite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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