drupal_add_feed

Versions
5 – 7
drupal_add_feed($url = NULL, $title = '')

Add a feed URL for the current page.

This function can be called as long the HTML header hasn't been sent.

Parameters

$url A url for the feed.

$title The title of the feed.

▾ 8 functions call 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.
node_page_default in modules/node/node.module
Menu callback; Generate a listing of promoted nodes.
taxonomy_term_page in modules/taxonomy/taxonomy.pages.inc
Menu callback; displays all nodes associated with a term.
template_preprocess_forums in modules/forum/forum.module
Process variables for forums.tpl.php

Code

includes/common.inc, line 373

<?php
function drupal_add_feed($url = NULL, $title = '') {
  $stored_feed_links = &drupal_static(__FUNCTION__, array());

  if (isset($url)) {
    $stored_feed_links[$url] = theme('feed_icon', array('url' => $url, 'title' => $title));

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

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.