--- link.module +++ link.module @@ -478,6 +478,9 @@ function link_theme() { 'link_formatter_plain' => array( 'variables' => array('element' => NULL), ), + 'link_formatter_title_plain' => array( + 'arguments' => array('element' => NULL), + ), 'link_formatter_url' => array( 'variables' => array('element' => NULL), ), @@ -600,6 +603,11 @@ function link_field_formatter_info() { 'field types' => array('link_field'), 'multiple values' => FIELD_BEHAVIOR_DEFAULT, ), + 'title_plain' => array( + 'label' => t('Title, as plain text'), + 'field types' => array('link_field'), + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), 'url' => array( 'label' => t('URL, as link'), 'field types' => array('link_field'), @@ -669,6 +677,13 @@ function theme_link_formatter_plain($vars) { } /** + * Theme function for 'title_plain' text field formatter. + */ +function theme_link_formatter_title_plain($vars) { + return empty($vars['element']['title']) ? '' : check_plain($vars['element']['title']); +} + +/** * Theme function for 'url' text field formatter. */ function theme_link_formatter_url($vars) {