function block_block_build_local_actions_block_alter

Implements hook_block_build_BASE_BLOCK_ID_alter().

File

core/modules/block/block.module, line 324

Code

function block_block_build_local_actions_block_alter(array &$build, BlockPluginInterface $block) {
    $build['#lazy_builder_preview'] = [
        '#type' => 'container',
        '#attributes' => [
            'class' => [
                'invisible',
            ],
        ],
        'actions' => [
            '#theme' => 'menu_local_action',
            '#link' => [
                'title' => t('Add'),
                'url' => Url::fromUserInput('#'),
            ],
        ],
    ];
}

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