Skip to content
Snippets Groups Projects
Commit 90ac87a0 authored by Monish Deb's avatar Monish Deb
Browse files

Documentation for hook_civicrm_alterEntityRefParams

parent 5bb81841
Branches
No related tags found
No related merge requests found
# hook_civicrm_alterEntityRefParams
## Summary
Allows you to modify entityRef field params.
## Availability
This hook is available in CiviCRM 4.7.27+ (maybe depends on the commit).
## Definition
hook_civicrm_alterEntityRefParams(&$params)
## Parameters
- @param array $params - parameters of entityRef field
## Details
This hook is called when entityRef field is rendered in form, which allows you to modify the parameters used to fetch options for this kind of field.
## Example
```php
function myextension_civicrm_alterEntityRefParams(&$params) {
// use your custom API to fetch tags of your choice
if ($params['entity'] == 'tag') {
$params['entity'] = 'my_tags';
$params['api'] = array('params' => array('parent_id' => 292));
}
...
}
```
......@@ -79,6 +79,7 @@ This is an overview list of all available hooks, listed by category.
* **[<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.
* **[hook_civicrm_xmlMenu](/hooks/hook_civicrm_xmlMenu.md)** - called when building CiviCRM's menu structure, which is used to render urls in CiviCRM.
* **[hook_civicrm_alterEntityRefParams](/hooks/hook_civicrm_alterEntityRefParams.md)** - called when building CiviCRM's entityRef field is rendered, allowing you to modify the entityRef parameters to fetch select options as per your need.
## Mail hooks
......
......@@ -119,6 +119,7 @@ pages:
- <del>hook_civicrm_tabs</del>: hooks/hook_civicrm_tabs.md
- hook_civicrm_tabset: hooks/hook_civicrm_tabset.md
- hook_civicrm_xmlMenu: hooks/hook_civicrm_xmlMenu.md
- hook_civicrm_alterEntityRefParams: hooks/hook_civicrm_alterEntityRefParams.md
- Mail Hooks:
- hook_civicrm_alterMailContent: hooks/hook_civicrm_alterMailContent.md
- hook_civicrm_alterMailer: hooks/hook_civicrm_alterMailer.md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment