You are here

function hook_crm_core_activity_type_add_fields_alter in CRM Core 7

Provides possibility to change default fields that will be added to the recently created bundle of activity.

Parameters

$fields: Array with fields that are going to be added to the activity bundle.

CRMActivityType $activity_type: Bundle of activity entity that was recently created.

See also

field_create_field()

_crm_core_activity_type_default_fields()

1 invocation of hook_crm_core_activity_type_add_fields_alter()
crm_core_activity_type_add_default_fields in modules/crm_core_activity/crm_core_activity.admin.inc
Add default fields to newly created activity type.

File

./crm_core.api.php, line 75
Hooks provided by the CRM Core module.

Code

function hook_crm_core_activity_type_add_fields_alter(&$fields, CRMActivityType $activity_type) {

  // Prevent field_activity_date from creation.
  foreach ($fields as $key => $field) {
    if ($field['field_name'] == 'field_activity_date') {
      unset($fields[$key]);
    }
  }
}