drupal_add_feed

5 common.inc drupal_add_feed($url = NULL, $title = '')
6 common.inc drupal_add_feed($url = NULL, $title = '')
7 common.inc drupal_add_feed($url = NULL, $title = '')
8 common.inc drupal_add_feed($url = NULL, $title = '')

Add a feed URL for the current page.

Parameters

$url: A url for the feed.

$title: The title of the feed.

8 calls to drupal_add_feed()

File

includes/common.inc, line 183
Common functions that many Drupal modules will need to reference.

Code

function drupal_add_feed($url = NULL, $title = '') {
  static $stored_feed_links = array();

  if (!is_null($url) && !isset($stored_feed_links[$url])) {
    $stored_feed_links[$url] = theme('feed_icon', $url, $title);

    drupal_add_link(array(
      'rel' => 'alternate', 
      'type' => 'application/rss+xml', 
      'title' => $title, 
      'href' => $url,
    ));
  }
  return $stored_feed_links;
}
Login or register to post comments