Skip to content

Instantly share code, notes, and snippets.

@barraponto
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barraponto/8898945 to your computer and use it in GitHub Desktop.
Save barraponto/8898945 to your computer and use it in GitHub Desktop.
<?php
/**
* Default theme function for all RSS rows.
*/
function YOURTHEME_preprocess_views_view_row_rss(&$vars) {
$item = &$vars['row'];
// Default item_elements to empty string.
$vars['item_elements'] = '';
if (!empty($item->elements)) {
// If there are item_elements, format them as xml elements.
$vars['item_elements'] = format_xml_elements(
// But first filter out any unwanted element.
array_filter($item->elements, function($element) {
// Some other keys: 'dc:creator', 'category'
return !in_array($element['key'], array('pubDate'));
})
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment