pbOnBeforeUnPublished
Triggers before unpublishing a block or table
Parameters
| Parameter | Description |
|---|---|
| type | Type: pbBlock|pbTable |
| id | Object id |
| object | Object |
| unpublished | Permission to unpublish |
| message | Custom message |
Examples
Do not allow unpublishing blocks.
php
if ($modx->event->name === 'pbOnBeforeUnPublished') {
if ($type === 'pbBlock') {
$modx->event->params['unpublished'] = false;
$modx->event->params['message'] = "You cannot unpublish";
}
}