function comment_field_extra_fields

Implements hook_field_extra_fields().

File

modules/comment/comment.module, line 167

Code

function comment_field_extra_fields() {
    $return = array();
    foreach (node_type_get_types() as $type) {
        if (variable_get('comment_subject_field_' . $type->type, 1) == 1) {
            $return['comment']['comment_node_' . $type->type] = array(
                'form' => array(
                    'author' => array(
                        'label' => t('Author'),
                        'description' => t('Author textfield'),
                        'weight' => -2,
                    ),
                    'subject' => array(
                        'label' => t('Subject'),
                        'description' => t('Subject textfield'),
                        'weight' => -1,
                    ),
                ),
            );
        }
    }
    return $return;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.