Developer API

Events Archive Template File

A regular post type archive of events can be found at yoursite.com/events. This archive displays events in the order that they occur. You can easily customize the appearance of this archive by creating a file called "archive-sc_event.php" an then modifying it to suit your needs. If you choose to customize your archive, you should also create a file called "taxonomy-sc_event_category.php" and copy the contents of archive-sc_event.php to it. This taxonomy-sc_event_category.php file will be used when displaying an archive for an event category. [/toggle] [toggle title="Single Event View"] By default, Sugar Event Calendar will render single event detail pages using the single.php file included with your theme. If you wish to customize the appearance of this page, create a file called "single-sc_event.php", copy the contents from single.php, and then customize to suit your needs. 

Actions

The plugin includes several action hooks that you can use to add additional content (or execute functions) in various places:

  • sc_before_calendar - Runs before any calendar HTML is outputted
  • sc_after_calendar - Runs after the final calendar HTML is outputted
  • sc_before_event_content - Runs before the content of a single event page is displayed
  • sc_after_event_content - Runs after the content of a single event page is displayed
  • sc_event_meta_box_before - Runs at the top of the "Event Details" meta box in the admin
  • sc_event_meta_box_after - Runs at the bottom of the "Event Details" meta box in the admin
  • sc_before_calendar_widget - Runs before the calendar widget HTML
  • sc_after_calendar_widget - Runs after the calendar widget HTML
  • sc_before_event_list_widget - Runs before the event list widget
  • sc_after_event_list_widget - Runs after the event list widget
  • sc_before_category_widget - Runs before the event categories widget
  • sc_after_category_widget - Runs after the event categories widget
  • sc_before_filter_widget - Runs before the event filter widget
  • sc_after_filter_widget - Runs after the event filter widget

Filters

The plugin includes several filter hooks that you can use to manipulate the behavior of the plugin:

  • sc_event_list_query - This filter can be used to change the query parameters of the query used to retrieve events for the "Event List" widget
  • sc_calendar_query_args - This filter can be used to change the query parameters of the query used to retrieve events for the calendars
  • sc_event_labels - This filter can be used to change the post type labels for the Events post type
  • sc_event_rewrite - This filter can be used to change the "rewrite" parameter for the Events post type
  • sc_event_supports - This filter can be used to change the "support" attributes for the Events post type
  • sc_event_category_labels - This filter can used for changing the Event Category labels
  • sc_event_category_rewrite - This filter can be used for changing the "rewrite" parameter of the Events Category taxonomy