diff --git a/title.field.inc b/title.field.inc index 15590cf..379d5cd 100644 --- a/title.field.inc +++ b/title.field.inc @@ -107,15 +107,18 @@ function title_field_formatter_view($entity_type, $entity, $field, $instance, $l $wrap_tag = isset($settings['title_style']) ? $settings['title_style'] : '_none'; if ($wrap_tag != '_none') { - $output = theme('html_tag', array( + $element = array( 'element' => array( '#tag' => $wrap_tag, - '#attributes' => array( - 'class' => $settings['title_class'], - ), '#value' => $output, ), - )); + ); + + if (!empty($settings['title_class'])) { + $element['#attributes'] = array('class' => $settings['title_class']); + } + + $output = theme('html_tag', $element); } $element = array(