You are here

public function BUEditorToolbarWrapper::remove in BUEditor 8

Same name and namespace in other branches
  1. 8.2 src/BUEditorToolbarWrapper.php \Drupal\bueditor\BUEditorToolbarWrapper::remove()

Removes an item or a list of items.

File

src/BUEditorToolbarWrapper.php, line 88

Class

BUEditorToolbarWrapper
Defines a class that manages BUEditor toolbar data.

Namespace

Drupal\bueditor

Code

public function remove($id) {
  $ids = is_array($id) ? $id : [
    $id,
  ];
  $this->toolbar = array_diff($this->toolbar, $ids);
  foreach ($ids as $id) {
    unset($this->assocToolbar[$id]);
  }
  return $this;
}