Hooks: Actions and Filters

What are hooks?

Hooks allow you to change or run code without having to modify any existing files. They are used extensively in WordPress and are the backbone to how many plugins operate.

WordPress has two different types of hooks: actions and filters.

  • Action hooks allow you to insert (or run) code at various points.
  • Filter hooks allow you to take a variable and manipulate it before returning it to original point that it came from.

Using hooks

There are a couple of different ways that you can use a hook to add your own custom code:

  1. The first way is by adding the code to the functions.php file of your custom child theme.
  2. The second way is by using a plugin like Code Snippets.

If you would like to read more about Hooks, please see the WordPress Plugin Handbook on Hooks.

Action and Filter Hook Reference

hey_notify_event_typesfilterFilter the Event Types dropdown options.
hey_notify_event_actionsfilterFilter the Event Actions dropdown options.
hey_notify_add_action_{$type}actionAdd actions to this Event Type.
hey_notify_service_fieldsfilterFilter the service fields to add your own settings.
hey_notify_services_optionsfilterFilter the service options to add a new service.
hey_notify_send_message_{$service}actionTriggers a service to process a message.
hey_notify_settings_generalfilterFilter the General settings.
hey_notify_settings_uninstallfilterFilter the Uninstall settings.
hey_notify_slack_settings_{$trigger}filterRetrieves the service settings. Hey Notify’s $trigger is ‘core’.
hey_notify_discord_settings_{$trigger}filterRetrieves the service settings. Hey Notify’s $trigger is ‘core’.
hey_notify_email_settings_{$trigger}filterRetrieves the service settings. Hey Notify’s $trigger is ‘core’.
hey_notify_message_sentactionRuns after a message is sent/processed.