eventsmanager

Modify WP FullCalendar JS options

Jul 27th, 2015
408
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. This snippet will limit the displayed hours for day/week views. You can use this snippet to modify any value in the fullcalendar options as per the documentation - http://fullcalendar.io/docs1/ (this is for WP FullCalendar below v1.0)
  4.  
  5. For information on where to paste this, see here - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  6. */
  7. function my_wp_fullcalendar_args(){
  8.     ?>
  9.     <script type="text/javascript">
  10.     jQuery(document).bind('wpfc_fullcalendar_args', function( e, options ){
  11.         options.minTime = "9:00am";
  12.         options.maxTime = "5:00pm";
  13.     });
  14.     </script>
  15.     <?php
  16. }
  17. add_action('wp_head','my_wp_fullcalendar_args');
RAW Paste Data