1 common.inc format_rss_item($title, $link, $description, array $args = array())

Formats a single RSS item.

Arbitrary elements may be added using the $args associative array.

Parameters

string $title: RSS title.

string $link: RSS URL.

string $description: RSS description.

array $args: Array of arbitrary elements.

Return value

string: RSS item

Related topics

File

core/includes/common.inc, line 2351
Common functions that many Backdrop modules will need to reference.

Code

function format_rss_item($title, $link, $description, array $args = array()) {
  $output = "<item>\n";
  $output .= ' <title>' . check_plain($title) . "</title>\n";
  $output .= ' <link>' . check_url($link) . "</link>\n";
  $output .= ' <description>' . check_plain($description) . "</description>\n";
  $output .= format_xml_elements($args);
  $output .= "</item>\n";

  return $output;
}