You are here

protected function RssFields::defineOptions in Views RSS 8.2

Same name in this branch
  1. 8.2 src/Plugin/views/style/RssFields.php \Drupal\views_rss\Plugin\views\style\RssFields::defineOptions()
  2. 8.2 src/Plugin/views/row/RssFields.php \Drupal\views_rss\Plugin\views\row\RssFields::defineOptions()
Same name and namespace in other branches
  1. 8.3 src/Plugin/views/row/RssFields.php \Drupal\views_rss\Plugin\views\row\RssFields::defineOptions()

Function defineOptions.

Overrides RowPluginBase::defineOptions

File

src/Plugin/views/row/RssFields.php, line 34

Class

RssFields
Renders an RSS item based on fields.

Namespace

Drupal\views_rss\Plugin\views\row

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $item_elements = views_rss_get('item_elements');
  if (count($item_elements)) {
    foreach ($item_elements as $module => $module_item_elements) {
      foreach (array_keys($module_item_elements) as $element) {
        list($namespace, $element_name) = views_rss_extract_element_names($element, 'core');
        $options['item']['contains'][$namespace]['contains'][$module]['contains'][$element_name] = [
          'default' => NULL,
        ];
      }
    }
  }
  return $options;
}