1 node.module node_field_extra_fields()

Implements hook_field_extra_fields().

File

core/modules/node/node.module, line 607
The core module that allows content to be submitted to the site.

Code

function node_field_extra_fields() {
  $extra = array();
  $module_language_enabled = module_exists('language');
  $description = t('Node module element');

  foreach (node_type_get_types() as $type) {
    if ($type->has_title) {
      $extra['node'][$type->type]['form']['title'] = array(
        'label' => $type->title_label,
        'description' => $description,
        'weight' => -5,
      );
    }

    // Add also the 'language' select if Language module is enabled and the
    // bundle has multilingual support.
    if ($module_language_enabled && $type->settings['language']) {
      $extra['node'][$type->type]['form']['langcode'] = array(
        'label' => t('Language'),
        'description' => $description,
        'weight' => 0,
      );
    }
  }

  return $extra;
}