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

Embed Snippet on Your Site

Set the ranges for Calendar List View | Display Eventbrite Events

The following code snippet filters the valid ranges for the next/prev keys of the 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/ )

Set the ranges for Calendar & Calendar List (Combined) View | Display Eventbrite Events
Code Snippet Available Here: https://library.wpcode.com/snippet/rod9pjy2/

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;
} );

Comments

Add a Comment