You are here

function hook_workbench_create_alter in Workbench 8

Same name and namespace in other branches
  1. 7 workbench.api.php \hook_workbench_create_alter()

Allows modules to alter the default content creation page.

Worekbench supplies a Create Content tab which emulates core's node/add page. The render array for this page may be modified by other modules.

Parameters

array $output: A Render API array of content items, passed by reference.

See also

WorkbenchContentController::addPage()

1 invocation of hook_workbench_create_alter()
WorkbenchContentController::addPage in src/Controller/WorkbenchContentController.php
Simple page to show list of content type to create.

File

./workbench.api.php, line 60
API documentation file for Workbench.

Code

function hook_workbench_create_alter(&$output) {
  if (\Drupal::currentUser()
    ->hasPermission('use workbench_media add form')) {
    $output['#content']['article']
      ->set('description', 'hello world');
  }
}