You are here

function quickedit_preprocess_page_title in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/quickedit/quickedit.module \quickedit_preprocess_page_title()
  2. 10 core/modules/quickedit/quickedit.module \quickedit_preprocess_page_title()

Implements hook_preprocess_HOOK() for the page title template.

File

core/modules/quickedit/quickedit.module, line 121
Provides in-place content editing functionality for fields.

Code

function quickedit_preprocess_page_title(&$variables) {
  $variables['#cache']['contexts'][] = 'user.permissions';
  if (\Drupal::currentUser()
    ->hasPermission('access in-place editing')) {
    $variables['title_attributes']['class'][] = 'js-quickedit-page-title';
  }
}