Last active
August 29, 2015 13:56
-
-
Save barraponto/8898945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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