From 26624ad600311fffa9aa7db24c9e14f252a998ec Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Sun, 19 Jan 2025 17:06:36 -0600 Subject: [PATCH] Add an array parameter for filtering from/to --- src/my-calendar-output.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/my-calendar-output.php b/src/my-calendar-output.php index 8a276e93..54faa1e8 100644 --- a/src/my-calendar-output.php +++ b/src/my-calendar-output.php @@ -1867,10 +1867,11 @@ function my_calendar( $args ) { * * @param {string} $from Start date of events shown in main calendar shortcode in format `yyyy-mm-dd`. * @param {string} $to Ending date of current view in format `yyyy-mm-dd`. + * @param {array} $params Calendar view parameters. * * @return {string} */ - $from = apply_filters( 'mc_from_date', $dates['from'], $dates['to'] ); + $from = apply_filters( 'mc_from_date', $dates['from'], $dates['to'], $params ); /** * Filter the calendar end date. * @@ -1878,10 +1879,11 @@ function my_calendar( $args ) { * * @param {string} $to End date of events shown in main calendar shortcode in format `yyyy-mm-dd`. * @param {string} $from Starting date of current view in format `yyyy-mm-dd`. + * @param {array} $params Calendar view parameters. * * @return {string} */ - $to = apply_filters( 'mc_to_date', $dates['to'], $dates['from'] ); + $to = apply_filters( 'mc_to_date', $dates['to'], $dates['from'], $params ); $from = ( 'day' === $params['time'] ) ? mc_date( 'Y-m-d', $current, false ) : $from; $to = ( 'day' === $params['time'] ) ? mc_date( 'Y-m-d', $current, false ) : $to; $query = array(