You are here

function theme_link_formatter_link_url in Link 7

Formats a link using an alternate display URL for its link text.

File

./link.module, line 1440
Defines simple link field types.

Code

function theme_link_formatter_link_url($vars) {

  // If no URL value is present there's no point in continuing.
  if (empty($vars['element']['url'])) {
    return '';
  }
  $link_options = $vars['element'];
  if (isset($link_options['attributes']['class'])) {
    $link_options['attributes']['class'] = array(
      $link_options['attributes']['class'],
    );
  }
  unset($link_options['title']);
  unset($link_options['url']);
  return l($vars['element']['display_url'], $vars['element']['url'], $link_options);
}