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.
In This Article
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 outputtedsc_after_calendar
: Runs after the final calendar HTML is outputtedsc_before_event_content
: Runs before the content of a single event page is displayedsc_after_event_content
: Runs after the content of a single event page is displayedsc_event_meta_box_before
: Runs at the top of the Event Details meta box in the adminsc_event_meta_box_after
: Runs at the bottom of the Event Details meta box in the adminsc_before_calendar_widget
: Runs before the calendar widget HTMLsc_after_calendar_widget
: Runs after the calendar widget HTMLsc_before_event_list_widget
: Runs before the event list widget HTMLsc_after_event_list_widget
: Runs after the event list widget HTMLsc_before_category_widget
: Runs before the event categories widget HTMLsc_after_category_widget
: Runs after the event categories widget HTMLsc_before_filter_widget
: Runs before the event filter widget HTMLsc_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.sugar_calendar_block_popover_event_description_length
: Use this filter to update the number of words in the description.sugar_calendar_block_popover_event_more_string
: Use this filter to change the “[…]” string displayed after the event description.
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.