You are here

function drupal_add_feed in Drupal 6

Same name and namespace in other branches
  1. 5 includes/common.inc \drupal_add_feed()
  2. 7 includes/common.inc \drupal_add_feed()

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()
aggregator_page_category in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the items aggregated in a particular category.
aggregator_page_last in modules/aggregator/aggregator.pages.inc
Menu callback; displays the most recent items gathered from any feed.
blog_page_last in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of all users.
blog_page_user in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of a given user.
drupal_get_feeds in includes/common.inc
Get the feed URLs for the current page.

... See full list

File

includes/common.inc, line 194
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;
}