You are here

function gutenberg_handle_messages in Gutenberg 8.2

Same name and namespace in other branches
  1. 8 gutenberg.module \gutenberg_handle_messages()

Store messages in drupal settings.

File

./gutenberg.module, line 575
Provides integration with the Gutenberg editor.

Code

function gutenberg_handle_messages(&$form) {
  $messages = \Drupal::messenger()
    ->deleteAll();
  $form['#attached']['drupalSettings']['gutenberg']['messages'] = $messages;
}