What does #optional mean for a "details" form element? The node edit form contains the following form element.

  $form['revision_information'] = array(
    '#type' =&gt; 'details',
    '#group' =&gt; 'advanced',
    '#title' =&gt; t('Revision information'),
    // Open by default when "Create new revision" is checked.
    '#open' =&gt; $node-&gt;isNewRevision(),
    '#attributes' =&gt; array(
      'class' =&gt; array('node-form-revision-information'),
    ),
    '#attached' =&gt; array(
      'library' =&gt; array('node/drupal.node'),
    ),
    '#weight' =&gt; 20,
    '#optional' =&gt; TRUE,
  );


What does the #optional property mean for it? 

I looked at both the Details and the VerticalTabs classes, but neither of them seems to handle that property.

What does setting #optional to TRUE do?
This is handled in the render element Details:

Details.php:

  public static function preRenderDetails($element) {
    ...
    // Do not render optional details elements if there are no children.
    if (isset($element['#parents'])) {
      $group = implode('][', $element['#parents']);
      if (!empty($element['#optional']) &amp;&amp; !Element::getVisibleChildren($element['#groups'][$group])) {
        $element['#printed'] = TRUE;
      }
    }
    return $element;
  }


If #optional is TRUE and there are no visible children, then the element is not rendered.