Hook Reference

Would you like to extend or customize the functionality of Sugar Calendar? This plugin includes several action and filter hooks allowing you to add content or modify the plugin’s behavior.

This tutorial will provide you with an overview of the available hooks in Sugar Calendar.


Action Hooks

Action hooks allow you to add custom content or execute functions at specific points in the plugin. Here are the available action hooks in Sugar Calendar:

  • 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 HTML
  • sc_after_event_list_widget: Runs after the event list widget HTML
  • sc_before_category_widget: Runs before the event categories widget HTML
  • sc_after_category_widget: Runs after the event categories widget HTML
  • sc_before_filter_widget: Runs before the event filter widget HTML
  • sc_after_filter_widget: Runs after the event filter widget HTML

Note: To learn more action hooks, be sure to check WordPress’ official documentation.

Filter Hooks

Filter hooks allow you to modify the plugin’s behavior by changing its data. Here are the available filter hooks:

  • sc_event_list_query: Use this filter to change the query parameters for retrieving events in the Event List widget.
  • sc_event_labels: Use this filter to change the post type labels for the Events post type.
  • sc_event_rewrite: Use this filter to change the rewrite parameter for the Events post type.
  • sc_event_supports: Use this filter to change the support attributes for the Events post type.
  • sc_event_category_labels: Use this filter to change the Event Category labels.
  • sc_event_category_rewrite: Use this filter to change the rewrite parameter of the Events Category taxonomy.
  • sc_event_calendar_link: Use this filter to change the link inside a Calendar view to a single Event.

Note: To learn more filter hooks, be sure to check WordPress’ official documentation.

That’s it! Now you have an overview of the action and filter hooks available in Sugar Calendar.

Next, would you like to customize the appearance of your Sugar Calendar event archives and single event pages? Be sure to check our tutorial on customizing template files to learn how.