content_moderation.views_execution.inc in Drupal 10
Same filename and directory in other branches
Provide views runtime hooks for content_moderation.module.
File
core/modules/content_moderation/content_moderation.views_execution.incView source
<?php
/**
* @file
* Provide views runtime hooks for content_moderation.module.
*/
use Drupal\views\ViewExecutable;
/**
* Implements hook_views_query_substitutions().
*/
function content_moderation_views_query_substitutions(ViewExecutable $view) {
$account = \Drupal::currentUser();
return [
'***VIEW_ANY_UNPUBLISHED_NODES***' => intval($account
->hasPermission('view any unpublished content')),
];
}
Functions
Name | Description |
---|---|
content_moderation_views_query_substitutions | Implements hook_views_query_substitutions(). |