Created
November 29, 2016 20:07
-
-
Save jaredatch/25da42d4e6283642be0bb534d42dc2a7 to your computer and use it in GitHub Desktop.
WPForms Timepicker limit times available
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 | |
| /** | |
| * WPForms limit times available in the timepicker, hide times that are disabled. | |
| * | |
| */ | |
| function wpf_limit_time_picker() { | |
| ?> | |
| <script type="text/javascript"> | |
| var wpforms_timepicker = { | |
| scrollDefault: 'now', | |
| forceRoundTime: true, | |
| disableTimeRanges: [ ['12:00am', '8:00am'],['11:30am', '11:59pm'] ] | |
| } | |
| </script> | |
| <style type="text/css"> | |
| .ui-timepicker-disabled{ display: none !important; } | |
| </style> | |
| <?php | |
| } | |
| add_action( 'wpforms_wp_footer', 'wpf_limit_time_picker' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment