Created
December 14, 2021 20:09
-
-
Save zackkatz/656e70093cc3cc33f33fcd509ffccc8c to your computer and use it in GitHub Desktop.
GravityView Calendar - Set start day to be Monday for a specific feed
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 | |
| /** | |
| * Change the start day to something other than the WordPress settings. | |
| * | |
| * The value must be a number that represents the day of the week. | |
| * Sunday=0, Monday=1, Tuesday=2, etc. | |
| * | |
| * @param array $calendar_options Calendar options | |
| * @param int $form_id Form ID | |
| * @param int $feed_id Calendar feed ID | |
| */ | |
| add_filter( 'gravityview/calendar/options', function( $calendar_options, $form_id, $feed_id ) { | |
| // | |
| // REPLACE 4 WITH THE ID OF YOUR CALENDAR FEED! | |
| // | |
| if( 4 !== $feed_id ) { | |
| return $calendar_options; | |
| } | |
| // Set the calendar week to start on Monday | |
| $calendar_options['firstDay'] = 1; | |
| return $calendar_options; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment