function Block::preBlockBuild
Allows to change the display settings right before executing the block.
Parameters
\Drupal\views\Plugin\Block\ViewsBlock $block: The block plugin for views displays.
File
- 
              core/modules/ views/ src/ Plugin/ views/ display/ Block.php, line 356 
Class
- Block
- The plugin that handles a block.
Namespace
Drupal\views\Plugin\views\displayCode
public function preBlockBuild(ViewsBlock $block) {
  $config = $block->getConfiguration();
  if (is_numeric($config['items_per_page']) && $config['items_per_page'] > 0) {
    // @todo Delete the intval() in https://www.drupal.org/project/drupal/issues/3521221
    $this->view
      ->setItemsPerPage(intval($config['items_per_page']));
  }
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
