function theme_feed_icon

Returns HTML for a feed icon.

Parameters

$variables: An associative array containing:

  • url: An internal system path or a fully qualified external URL of the feed.
  • title: A descriptive title of the feed.

Related topics

1 call to theme_feed_icon()
AddFeedTest::testFeedIconEscaping in drupal/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php
Checks that special characters are correctly escaped.
5 theme calls to theme_feed_icon()
AggregatorController::sources in drupal/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
Displays all the feeds used by the Aggregator module.
drupal_add_feed in drupal/core/includes/common.inc
Adds a feed URL for the current page.
Rss::attachTo in drupal/core/modules/views/lib/Drupal/views/Plugin/views/style/Rss.php
SyndicateBlock::build in drupal/core/modules/node/lib/Drupal/node/Plugin/Block/SyndicateBlock.php
Builds and returns the renderable array for this block plugin.
template_preprocess_aggregator_feed_source in drupal/core/modules/aggregator/aggregator.pages.inc
Prepares variables for aggregator feed source templates.

File

drupal/core/includes/theme.inc, line 2415
The theme system, which controls the output of Drupal.

Code

function theme_feed_icon($variables) {
  $text = t('Subscribe to !feed-title', array(
    '!feed-title' => $variables['title'],
  ));
  if ($image = theme('image', array(
    'uri' => 'core/misc/feed.png',
    'width' => 16,
    'height' => 16,
    'alt' => $text,
  ))) {
    return l($image, $variables['url'], array(
      'html' => TRUE,
      'attributes' => array(
        'class' => array(
          'feed-icon',
        ),
        'title' => $text,
      ),
    ));
  }
}