pbOnGetListBlocks
Triggers when retrieving the list of blocks.
Parameters
| Parameter | Description |
|---|---|
| array | Array of rows |
Examples
We remove the Gallery block from the list of all blocks for resources with a parent of 12
php
if ($modx->event->name === 'pbOnGetListBlocks') {
if ($parent_id === 12 && $type === 'pbBlock') {
$modx->event->params['array'] = array_filter($array, function($block){
return $block['name'] !== 'Gallery';
});
}
}