user.views_execution.inc

Same filename and directory in other branches
  1. 9 core/modules/user/user.views_execution.inc
  2. 8.9.x core/modules/user/user.views_execution.inc
  3. 10 core/modules/user/user.views_execution.inc

Provide views runtime hooks for user.module.

File

core/modules/user/user.views_execution.inc

View source
<?php


/**
 * @file
 * Provide views runtime hooks for user.module.
 */
use Drupal\views\ViewExecutable;

/**
 * Implements hook_views_query_substitutions().
 *
 * Allow replacement of current user ID so we can cache these queries.
 */
function user_views_query_substitutions(ViewExecutable $view) {
    return [
        '***CURRENT_USER***' => \Drupal::currentUser()->id(),
    ];
}

Functions

Title Deprecated Summary
user_views_query_substitutions Implements hook_views_query_substitutions().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.