function media_views_query_substitutions

Same name in other branches
  1. 8.9.x core/modules/media/media.module \media_views_query_substitutions()
  2. 10 core/modules/media/media.module \media_views_query_substitutions()

Implements hook_views_query_substitutions().

File

core/modules/media/media.module, line 524

Code

function media_views_query_substitutions(ViewExecutable $view) {
    $account = \Drupal::currentUser();
    return [
        '***VIEW_OWN_UNPUBLISHED_MEDIA***' => (int) $account->hasPermission('view own unpublished media'),
        '***ADMINISTER_MEDIA***' => (int) $account->hasPermission('administer media'),
    ];
}

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