You are here

public static function InlineEntityFormComplex::hideCancel in Inline Entity Form 8

Hides cancel button.

Parameters

array $element: Form array structure.

File

src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php, line 763

Class

InlineEntityFormComplex
Complex inline widget.

Namespace

Drupal\inline_entity_form\Plugin\Field\FieldWidget

Code

public static function hideCancel($element) {

  // @todo Name both buttons the same and simplify this logic.
  if (isset($element['actions']['ief_add_cancel'])) {
    $element['actions']['ief_add_cancel']['#access'] = FALSE;
  }
  elseif (isset($element['actions']['ief_reference_cancel'])) {
    $element['actions']['ief_reference_cancel']['#access'] = FALSE;
  }
  return $element;
}