You are here

function views_rss_core_preprocess_channel_category in Views RSS 6.2

Same name and namespace in other branches
  1. 8.3 modules/views_rss_core/views_rss_core.inc \views_rss_core_preprocess_channel_category()
  2. 8.2 modules/views_rss_core/views_rss_core.inc \views_rss_core_preprocess_channel_category()
  3. 7.2 modules/views_rss_core/views_rss_core.inc \views_rss_core_preprocess_channel_category()

Preprocess function for channel <category> element.

1 string reference to 'views_rss_core_preprocess_channel_category'
views_rss_core_views_rss_channel_elements in modules/views_rss_core/views_rss_core.module
Implementation of hook_views_rss_channel_elements().

File

modules/views_rss_core/views_rss_core.inc, line 52
Preprocess functions for Views RSS: Core Elements module.

Code

function views_rss_core_preprocess_channel_category(&$variables) {

  // No value = no preprocessing.
  if (empty($variables['value'])) {
    return;
  }
  $elements = array();
  $categories = explode(',', $variables['value']);
  foreach ($categories as $category) {
    $elements[] = array(
      'element' => $variables['element'],
      'value' => trim($category),
    );
  }
  $variables['value'] = array(
    'elements' => $elements,
  );
}