Newer
Older
mickadoo
committed
-- DO NOT EDIT
--
-- This entire page is auto-generated by the following command:
-- ./bin/tools generate:hooks-list
--
-->
This is an overview list of all available hooks, listed by category.
## Batch hooks
* **[hook_civicrm_batchItems](/hooks/hook_civicrm_batchItems.md)** - called when a CSV batch export file is about to be generated.
mickadoo
committed
* **[hook_civicrm_batchQuery](/hooks/hook_civicrm_batchQuery.md)** - called when the query of CSV batch export is generated.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
## Case hooks
* **[hook_civicrm_caseChange](/hooks/hook_civicrm_caseChange.md)** - fires whenever a record in a case changes.
* **[hook_civicrm_caseTypes](/hooks/hook_civicrm_caseTypes.md)** - defines available case types.
* **[hook_civicrm_post_case_merge](/hooks/hook_civicrm_post_case_merge.md)** - called after a case merge happens.
* **[hook_civicrm_pre_case_merge](/hooks/hook_civicrm_pre_case_merge.md)** - called before a case merge happens.
## Database hooks
* **[hook_civicrm_copy](/hooks/hook_civicrm_copy.md)** - called after a CiviCRM object (Event, ContributionPage, Profile) has been copied.
* **[hook_civicrm_custom](/hooks/hook_civicrm_custom.md)** - called *after* the database write on a custom table.
* **[hook_civicrm_managed](/hooks/hook_civicrm_managed.md)** - allows a module to declare a list of managed entities using the API.
* **[hook_civicrm_merge](/hooks/hook_civicrm_merge.md)** - allows modification of the data used to perform merging of duplicates. It can be useful if your custom module has added its own tables related to CiviCRM contacts.
* **[hook_civicrm_post](/hooks/hook_civicrm_post.md)** - called after a db write on some core objects.
* **[hook_civicrm_postSave_table_name](/hooks/hook_civicrm_postSave_table_name.md)** - called after writing to a database table that has an associated DAO, including core tables but not custom tables or log tables.
* **[hook_civicrm_pre](/hooks/hook_civicrm_pre.md)** - called before a db write on some core objects.
* **[hook_civicrm_trigger_info](/hooks/hook_civicrm_trigger_info.md)** - allows you to define MySQL triggers.
* **[hook_civicrm_referenceCounts](/hooks/hook_civicrm_referenceCounts.md)** - called to determine the reference-count for a record.
## Entity hooks
* **[hook_civicrm_entityTypes](/hooks/hook_civicrm_entityTypes.md)** - called for declaring managed entities via API.
## Extension lifecycle hooks
* **[hook_civicrm_disable](/hooks/hook_civicrm_disable.md)** - called when an extension is disabled.
* **[hook_civicrm_enable](/hooks/hook_civicrm_enable.md)** - called when an extension is re-enabled.
* **[hook_civicrm_install](/hooks/hook_civicrm_install.md)** - called when an extension is installed.
* **[hook_civicrm_postInstall](/hooks/hook_civicrm_postInstall.md)** - called immediately after an extension is installed.
* **[hook_civicrm_uninstall](/hooks/hook_civicrm_uninstall.md)** - called when an extension is uninstalled.
* **[hook_civicrm_upgrade](/hooks/hook_civicrm_upgrade.md)** - called when an administrator visits the "Manage Extensions" screen to determine if there are any pending upgrades.
## Form hooks
* **[hook_civicrm_alterContent](/hooks/hook_civicrm_alterContent.md)** - invoked after all the content of a CiviCRM form or page is generated and allows for direct manipulation of the generated content.
* **[hook_civicrm_alterTemplateFile](/hooks/hook_civicrm_alterTemplateFile.md)** - invoked while selecting the tpl file to use to render the page.
* **[hook_civicrm_buildForm](/hooks/hook_civicrm_buildForm.md)** - invoked when building a form. It can be used to set the default values of a form element, to change form elements attributes, and to add new fields to a form.
* **[hook_civicrm_idsException](/hooks/hook_civicrm_idsException.md)** - allows you to modify the list of form or page paths where submitted data should not be sent through PHPIDS, the intrusion detection system (IDS).
* **[hook_civicrm_postProcess](/hooks/hook_civicrm_postProcess.md)** - invoked when a CiviCRM form is submitted.
* **[hook_civicrm_preProcess](/hooks/hook_civicrm_preProcess.md)** - can be used to modify the behavior of a form before the `buildQuickForm` call.
* **[hook_civicrm_validateForm](/hooks/hook_civicrm_validateForm.md)** - allows you to customize the logic used to validate forms.
## GUI hooks
mickadoo
committed
* **[hook_civicrm_alterMenu](/hooks/hook_civicrm_alterMenu.md)** - called when building CiviCRM's list of HTTP routes and should be used when you want to register custom paths or URLS.
* **[hook_civicrm_buildAmount](/hooks/hook_civicrm_buildAmount.md)** - called when building the amount structure for a Contribution or Event Page, allowing you to modify the set of radio buttons representing amounts for contribution levels and event registration fees.
* **[hook_civicrm_caseSummary](/hooks/hook_civicrm_caseSummary.md)** - called when the manage case screen is displayed, and it allows the injection of label/value pairs which are rendered inside divs underneath the existing summary table.
* **[hook_civicrm_contact_get_displayname](/hooks/hook_civicrm_contact_get_displayname.md)** - called to retrieve the display name of a contact, allowing you to return a custom display name.
* **[<del>hook_civicrm_customFieldOptions</del>](/hooks/hook_civicrm_customFieldOptions.md)** - Deprecated in 4.7 in favor of [hook_civicrm_fieldOptions](/hooks/hook_civicrm_fieldOptions.md). Use that instead for modifying all option lists, not limited to custom fields.
* **[hook_civicrm_dashboard](/hooks/hook_civicrm_dashboard.md)** - called when rendering the dashboard page and can be used to add content to the dashboard page.
* **[hook_civicrm_dashboard_defaults](/hooks/hook_civicrm_dashboard_defaults.md)** - called while a contact views their dashboard for the first time and can be used to enable or disable the set of default dashlets.
* **[hook_civicrm_fieldOptions](/hooks/hook_civicrm_fieldOptions.md)** - allows you to dynamically modify the option list for any field (including custom fields).
* **[hook_civicrm_links](/hooks/hook_civicrm_links.md)** - allows you to modify action links including: the actions at the end of a search result row, the Create New dropdown, and the Actions dropdown at the top of a contact record.
* **[hook_civicrm_navigationMenu](/hooks/hook_civicrm_navigationMenu.md)** - called after the menus are rebuilt.
* **[hook_civicrm_pageRun](/hooks/hook_civicrm_pageRun.md)** - called before a CiviCRM page is rendered.
* **[hook_civicrm_searchColumns](/hooks/hook_civicrm_searchColumns.md)** - called after a search is done, allowing you to modify the headers and/or the values that are displayed as part of the search.
* **[hook_civicrm_searchTasks](/hooks/hook_civicrm_searchTasks.md)** - called to display the list of actions allowed after doing a search, allowing you to inject additional actions or to remove existing actions.
* **[hook_civicrm_summary](/hooks/hook_civicrm_summary.md)** - called when the contact summary is rendered, allowing you to modify the summary with your own content.
* **[hook_civicrm_summaryActions](/hooks/hook_civicrm_summaryActions.md)** - allows you to customize the context menu actions on the Contact Summary Page.
* **[<del>hook_civicrm_tabs</del>](/hooks/hook_civicrm_tabs.md)** - deprecated in 4.7 in favor of [hook_civicrm_tabset](/hooks/hook_civicrm_tabset.md).
* **[hook_civicrm_tabset](/hooks/hook_civicrm_tabset.md)** - called when composing the tabs interface used for contacts, contributions and events.
mickadoo
committed
* **[hook_civicrm_xmlMenu](/hooks/hook_civicrm_xmlMenu.md)** - called when building CiviCRM's menu structure, which is used to render urls in CiviCRM.
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
## Mail hooks
* **[hook_civicrm_alterMailContent](/hooks/hook_civicrm_alterMailContent.md)** - called after getting the content of the mail and before tokenizing it.
* **[hook_civicrm_alterMailer](/hooks/hook_civicrm_alterMailer.md)** - called when CiviCRM prepares an email driver class to handle outbound message delivery.
* **[hook_civicrm_alterMailParams](/hooks/hook_civicrm_alterMailParams.md)** - called when an email is about to be sent by CiviCRM.
* **[hook_civicrm_emailProcessor](/hooks/hook_civicrm_emailProcessor.md)** - called after *each* email has been processed by the script `bin/EmailProcessor.php`.
* **[hook_civicrm_emailProcessorContact](/hooks/hook_civicrm_emailProcessorContact.md)** - called by the Email Processor when deciding to which contact and activity will be attached.
* **[hook_civicrm_mailingGroups](/hooks/hook_civicrm_mailingGroups.md)** - called when composing a mailing allowing you to include or exclude other groups as needed.
* **[hook_civicrm_postEmailSend](/hooks/hook_civicrm_postEmailSend.md)** - called when an email has been successfully sent by CiviCRM, but not on an error.
* **[hook_civicrm_postMailing](/hooks/hook_civicrm_postMailing.md)** - called at the successful completion of a bulk mailing done through CiviMail.
* **[hook_civicrm_unsubscribeGroups](/hooks/hook_civicrm_unsubscribeGroups.md)** - called when CiviCRM receives a request to unsubscribe a user from a mailing.
## Permission hooks
* **[hook_civicrm_aclGroup](/hooks/hook_civicrm_aclGroup.md)** - called when composing the ACL to restrict access to civicrm entities (civicrm groups, profiles and events).
* **[hook_civicrm_aclWhereClause](/hooks/hook_civicrm_aclWhereClause.md)** - called when composing the ACL where clause to restrict visibility of contacts to the logged in user.
* **[hook_civicrm_alterAPIPermissions](/hooks/hook_civicrm_alterAPIPermissions.md)** - called when API 3 permissions are checked.
* **[hook_civicrm_permission](/hooks/hook_civicrm_permission.md)** - called to allow custom permissions to be defined.
* **[hook_civicrm_permission_check](/hooks/hook_civicrm_permission_check.md)** - called to dynamically alter permissions based on conditions or external criteria.
* **[hook_civicrm_selectWhereClause](/hooks/hook_civicrm_selectWhereClause.md)** - called when executing a SELECT query.
## Profile hooks
* **[hook_civicrm_buildProfile](/hooks/hook_civicrm_buildProfile.md)** - called while preparing a profile form.
* **[hook_civicrm_buildUFGroupsForModule](/hooks/hook_civicrm_buildUFGroupsForModule.md)** - called when ufgroups (profiles) are being built for a module.
* **[hook_civicrm_processProfile](/hooks/hook_civicrm_processProfile.md)** - called when processing a valid profile form submission (e.g. for "civicrm/profile/create" or "civicrm/profile/edit").
* **[hook_civicrm_searchProfile](/hooks/hook_civicrm_searchProfile.md)** - called while preparing a list of contacts (based on a profile).
* **[hook_civicrm_validateProfile](/hooks/hook_civicrm_validateProfile.md)** - called while validating a profile form submission.
* **[hook_civicrm_viewProfile](/hooks/hook_civicrm_viewProfile.md)** - called while preparing a read-only profile screen.
## Report hooks
* **[hook_civicrm_alterReportVar](/hooks/hook_civicrm_alterReportVar.md)** - used to add or modify display columns and filters.
## SMS hooks
* **[hook_civicrm_inboundSMS](/hooks/hook_civicrm_inboundSMS.md)** - called when an inbound SMS has been received, processed by the provider extension, but not matched or processed by CiviSMS.
## Uncategorized hooks
* **[hook_civicrm_alterBadge](/hooks/hook_civicrm_alterBadge.md)** - allows you to modify the content and format of name badges.
* **[hook_civicrm_alterBarcode](/hooks/hook_civicrm_alterBarcode.md)** - allows you to modify the content that is encoded in barcode.
* **[hook_civicrm_alterCalculatedMembershipStatus](/hooks/hook_civicrm_alterCalculatedMembershipStatus.md)** - called when calculating the membership status.
* **[hook_civicrm_alterLogTables](/hooks/hook_civicrm_alterLogTables.md)** - allows you to amend the specification of the log tables to be created when logging is turned on.
* **[hook_civicrm_alterMailingLabelParams](/hooks/hook_civicrm_alterMailingLabelParams.md)** - called to alter the parameters used to generate mailing labels.
* **[hook_civicrm_alterPaymentProcessorParams](/hooks/hook_civicrm_alterPaymentProcessorParams.md)** - allows you to modify parameters passed to the payment processor.
* **[hook_civicrm_alterSettingsFolders](/hooks/hook_civicrm_alterSettingsFolders.md)** - allows modules and extensions to scan for settings in additional folders.
mickadoo
committed
* **[hook_civicrm_alterSettingsMetaData](/hooks/hook_civicrm_alterSettingsMetaData.md)** - called when Settings have been loaded from the xml. It is an opportunity for hooks to alter the data.
* **[hook_civicrm_angularModules](/hooks/hook_civicrm_angularModules.md)** - generates a list of AngularJS modules and allows you to register additional AngularJS modules. It is currently **experimental**.
* **[hook_civicrm_apiWrappers](/hooks/hook_civicrm_apiWrappers.md)** - allows you to add, override, or remove methods to be called before and after api calls — and to modify either the parameters or the result of the call.
* **[hook_civicrm_buildAsset](/hooks/hook_civicrm_buildAsset.md)** - fires whenever the system builds a semi-dynamic asset.
* **[hook_civicrm_buildStateProvinceForCountry](/hooks/hook_civicrm_buildStateProvinceForCountry.md)** - called during the ajax callback that is used to build the options that display in the State/Province select widget for a specific country, and can be used to alter the list of State/Province options for particular countries.
* **[hook_civicrm_check](/hooks/hook_civicrm_check.md)** - called by the "System Check" api.
* **[hook_civicrm_config](/hooks/hook_civicrm_config.md)** - called soon after the `CRM_Core_Config` object has been initialized.
* **[<del>hook_civicrm_contactListQuery</del>](/hooks/hook_civicrm_contactListQuery.md)** - Deprecated in favor of [hook_civicrm_apiWrappers](/hooks/hook_civicrm_apiWrappers.md).
* **[hook_civicrm_container](/hooks/hook_civicrm_container.md)** - modifies the CiviCRM container allowing you to add new services, parameters, extensions, etc.
* **[hook_civicrm_coreResourceList](/hooks/hook_civicrm_coreResourceList.md)** - called when the list of core js/css resources is about to be processed, giving you the opportunity to modify the list prior to the resources being added, or add your own.
* **[hook_civicrm_cron](/hooks/hook_civicrm_cron.md)** - called every time the CiviCRM scheduler is polled.
* **[hook_civicrm_crudLink](/hooks/hook_civicrm_crudLink.md)** - Generate a default CRUD URL for an entity.
* **[hook_civicrm_dupeQuery](/hooks/hook_civicrm_dupeQuery.md)** - called during the dedupe lookup process, and can be used to alter the parameters and queries used to determine if two contacts are duplicates.
* **[hook_civicrm_eventDiscount](/hooks/hook_civicrm_eventDiscount.md)** - allows you to apply a customized discount to an event registration.
* **[hook_civicrm_export](/hooks/hook_civicrm_export.md)** - allows to manipulate or change the output of CSV during export.
* **[hook_civicrm_fileSearches](/hooks/hook_civicrm_fileSearches.md)** - allows you to add a reference to a file search service (e.g. Solr).
mickadoo
committed
* **[hook_civicrm_geocoderFormat](/hooks/hook_civicrm_geocoderFormat.md)** - allows you to manipulate the Address object during geocoding, for instance to extract additional fields from the geocoder's returned XML.
* **[hook_civicrm_import](/hooks/hook_civicrm_import.md)** - called after contacts have been imported into the system, and before the temp import table has been destroyed.
* **[hook_civicrm_membershipTypeValues](/hooks/hook_civicrm_membershipTypeValues.md)** - called when composing the array of membership types and their costs during a membership registration (new or renewal).
* **[hook_civicrm_notePrivacy](/hooks/hook_civicrm_notePrivacy.md)** - provides a way to override the default privacy behavior for notes.
* **[<del>hook_civicrm_optionValues</del>](/hooks/hook_civicrm_optionValues.md)** - deprecated in 4.7 in favor of [hook_civicrm_fieldOptions](/hooks/hook_civicrm_fieldOptions.md).
* **[hook_civicrm_queryObjects](/hooks/hook_civicrm_queryObjects.md)** - called while building the core search query, allowing you to provide your own query objects which alter or extend the core search.
* **[hook_civicrm_recent](/hooks/hook_civicrm_recent.md)** - called before storing recently viewed items.
* **[hook_civicrm_tokens](/hooks/hook_civicrm_tokens.md)** - called to allow custom tokens to be defined.
* **[hook_civicrm_tokenValues](/hooks/hook_civicrm_tokenValues.md)** - called to get all the values for the tokens registered.
* **[hook_civicrm_unhandledException](/hooks/hook_civicrm_unhandledException.md)** - fires when an unhandled exception (fatal error) occurs.