You are here

function gutenberg_form_node_form_details_after_build in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 gutenberg.module \gutenberg_form_node_form_details_after_build()

Called by form after build.

1 string reference to 'gutenberg_form_node_form_details_after_build'
gutenberg_form_node_form_alter in ./gutenberg.module
Implements hook_form_node_form_alter().

File

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

Code

function gutenberg_form_node_form_details_after_build(array $element, FormStateInterface $form_state) {

  // gutenberg_handle_messages($element);
  foreach ($element['#fields_with_details'] as $value) {
    $element['#attached']['drupalSettings']['gutenberg']['metaboxes'][] = $element[$value]['widget'][0]['#id'];
  }
  return $element;
}