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:
- The first way is by adding the code to the
functions.php
file of your custom child theme. - 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
Hook | Type | Description |
---|---|---|
hey_notify_event_types | filter | Filter the Event Types dropdown options. |
hey_notify_event_actions | filter | Filter the Event Actions dropdown options. |
hey_notify_add_action_{$type} | action | Add actions to this Event Type. |
hey_notify_service_fields | filter | Filter the service fields to add your own settings. |
hey_notify_services_options | filter | Filter the service options to add a new service. |
hey_notify_send_message_{$service} | action | Triggers a service to process a message. |
hey_notify_settings_general | filter | Filter the General settings. |
hey_notify_settings_uninstall | filter | Filter the Uninstall settings. |
hey_notify_slack_settings_{$trigger} | filter | Retrieves the service settings. Hey Notify’s $trigger is ‘core’. |
hey_notify_discord_settings_{$trigger} | filter | Retrieves the service settings. Hey Notify’s $trigger is ‘core’. |
hey_notify_email_settings_{$trigger} | filter | Retrieves the service settings. Hey Notify’s $trigger is ‘core’. |
hey_notify_message_sent | action | Runs after a message is sent/processed. |