You are here

function scheduler_views_data_alter in Scheduler 8

Same name and namespace in other branches
  1. 2.x scheduler.module \scheduler_views_data_alter()

Implements hook_views_data_alter().

File

./scheduler.module, line 391
Scheduler publishes and unpublishes nodes on dates specified by the user.

Code

function scheduler_views_data_alter(array &$data) {

  // By default the 'is null' and 'is not null' operators are only added to the
  // list of filter options if the view contains a relationship. We want them to
  // be always available for the scheduler date fields.
  $data['node_field_data']['publish_on']['filter']['allow empty'] = TRUE;
  $data['node_field_data']['unpublish_on']['filter']['allow empty'] = TRUE;
  $data['node_field_revision']['publish_on']['filter']['allow empty'] = TRUE;
  $data['node_field_revision']['unpublish_on']['filter']['allow empty'] = TRUE;
}