You are here

function views_rss_core_preprocess_item_guid in Views RSS 8.2

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

Preprocess function for item <guid> element.

1 string reference to 'views_rss_core_preprocess_item_guid'
views_rss_core_views_rss_item_elements in modules/views_rss_core/views_rss_core.module
Implements hook_views_rss_item_elements().

File

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

Code

function views_rss_core_preprocess_item_guid(&$variables) {

  // No value = no preprocessing.
  if (empty($variables['elements'][0]['value'])) {
    return;
  }

  // Hack for using CDN files.
  // @todo make this into a hook of some kind
  _convert_to_external_file($variables['elements'][0]['value']);
  $is_permalink = 'false';
  if (!empty($variables['item']['views_rss_core']['link']) && UrlHelper::isValid($variables['elements'][0]['value'], TRUE)) {
    $is_permalink = 'true';
  }
  $variables['elements'][0]['attributes']['isPermaLink'] = $is_permalink;
}