function block_content_post_update_move_custom_block_library

Moves the custom block library to Content.

File

core/modules/block_content/block_content.post_update.php, line 32

Code

function block_content_post_update_move_custom_block_library() {
  if (!\Drupal::service('module_handler')->moduleExists('views')) {
    return;
  }
  if (!($view = View::load('block_content'))) {
    return;
  }
  $display =& $view->getDisplay('page_1');
  if (empty($display) || $display['display_options']['path'] !== 'admin/structure/block/block-content') {
    return;
  }
  $display['display_options']['path'] = 'admin/content/block';
  $menu =& $display['display_options']['menu'];
  $menu['title'] = 'Blocks';
  $menu['description'] = 'Create and edit block content.';
  $menu['expanded'] = FALSE;
  $menu['parent'] = 'system.admin_content';
  $view->set('label', 'Content blocks');
  $view->save();
}

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