Home / Widgets / Set the ranges for Calendar & Calendar List (Combined) View | Display Eventbrite Events
Duplicate Snippet

Embed Snippet on Your Site

Set the ranges for Calendar & Calendar List (Combined) View | Display Eventbrite Events

The following code snippet filters the valid ranges for the next/prev keys of the calendar and calendar list views to plus of minus 5 month.

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

Code Preview
php
<?php
/**
 * 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;
} );

Comments

Add a Comment