hook_def_alter

Definition

hook_def_alter(&$def)
importexportapi/docs/developer/hooks/importexportapi.php, line 66

Description

Alter the data definition of one or more entities and its fields, as defined through hook_def().

Parameters

&$def The data definitions of all entities and their fields, as defined through hook_def(). This parameter should be modified directly, as all changes to it are passed back by reference.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_def_alter(&$def) {
  if (isset($def['user'])) {
    $def['user']['mode'] = array(
      '#type' => 'int',
      '#title' => t('Comment viewing mode')
    );
    $def['user']['sort'] = array(
      '#type' => 'int',
      '#title' => t('Comment viewing order')
    );
    $def['user']['signature'] = array(
      '#title' => t('Signature')
    );
  }
}
?>