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 Hook Reference
Hook | Type | Description |
---|---|---|
hey_notify_add_action_{$type} | action | Add actions to this Event Type. |
hey_notify_send_message_{$service} | action | Triggers a service to process a message. |
hey_notify_message_sent | action | Runs after a message is sent/processed. |
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_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_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_comment_new_subject | filter | Filter the New Comment notification subject. |
hey_notify_cpt_draft_subject | filter | Filter the Custom Post Type Draft notification subject. |
hey_notify_cpt_published_subject | filter | Filter the Custom Post Type Published notification subject. |
hey_notify_cpt_scheduled_subject | filter | Filter the Custom Post Type Scheduled notification subject. |
hey_notify_cpt_pending_subject | filter | Filter the Custom Post Type Pending notification subject. |
hey_notify_cpt_updated_subject | filter | Filter the Custom Post Type Updated notification subject. |
hey_notify_cpt_trashed_subject | filter | Filter the Custom Post Type Trashed notification subject. |
hey_notify_page_draft_subject | filter | Filter the Page Draft notification subject. |
hey_notify_page_published_subject | filter | Filter the Page Published notification subject. |
hey_notify_page_scheduled_subject | filter | Filter the Page Scheduled notification subject. |
hey_notify_page_pending_subject | filter | Filter the Page Pending notification subject. |
hey_notify_page_updated_subject | filter | Filter the Page Updated notification subject. |
hey_notify_page_trashed_subject | filter | Filter the Page Trashed notification subject. |
hey_notify_post_draft_subject | filter | Filter the Post Draft notification subject. |
hey_notify_post_published_subject | filter | Filter the Post Published notification subject. |
hey_notify_post_scheduled_subject | filter | Filter the Post Scheduled notification subject. |
hey_notify_post_pending_subject | filter | Filter the Post Pending notification subject. |
hey_notify_post_updated_subject | filter | Filter the Post Updated notification subject. |
hey_notify_post_trashed_subject | filter | Filter the Post Trashed notification subject. |
hey_notify_system_core_update_subject | filter | Filter the WordPress Update notification subject. |
hey_notify_system_theme_update_subject | filter | Filter the Theme Update notification subject. |
hey_notify_system_plugin_update_subject | filter | Filter the Plugin Update notification subject. |
hey_notify_system_plugin_activated_subject | filter | Filter the Plugin Activated notification subject. |
hey_notify_system_plugin_deactivated_subject | filter | Filter the Plugin Deactivated notification subject. |
hey_notify_system_theme_changed_subject | filter | Filter the Theme Changed notification subject. |
hey_notify_user_new_subject | filter | Filter the New User notification subject. |
hey_notify_user_admin_login_subject | filter | Filter the Administrator Login notification subject. |
hey_notify_user_admin_login_failed_subject | filter | Filter the Administrator Login Failed notification subject. |