Display message in the panel from hook

Is there a way to display a message (error, info…) to an editor from a hook ?
I want to perform some checks on page creation and display some instructions to the site editor if some requirements are not met.

Yes, that’s possible via throwing an Exception

'page.update:after' => function ( $newPage , $oldPage ) {

  throw new Exception('Page Updated');

1 Like

Thanks. That did the trick.