src/Extensions/GridFieldBetterButtonsItemRequest.php
protected function filterFieldList(Form $form, FieldList $actions)
    {
        $list = FieldList::create();

        foreach ($actions as $a) {
            if (!$a instanceof BetterButtonInterface) {
                throw new Exception("{$buttonObj->class} must implement BetterButtonInterface");
            }

            $a->bindGridField($form, $this->owner);

            if (!$a->shouldDisplay()) {
                continue;
            }

            if (($a instanceof BetterButton_Versioned) && !$this->owner->record->checkVersioned()) {
                continue;
            }

            $list->push($a);
        }

        return $list;
    }
protected function filterFieldList(Form $form, FieldList $actions)
    {
        $list = FieldList::create();

        foreach ($actions as $a) {
            if (!$a instanceof BetterButtonInterface) {
                throw new Exception("{$buttonObj->class} must implement BetterButtonInterface");
            }

            $a->bindGridField($form, $this->owner);

            if (!$a->shouldDisplay()) {
                continue;
            }

            if (($a instanceof BetterButton_Versioned) && !$this->owner->record->checkVersioned()) {
                continue;
            }

            $list->push($a);
        }

        return $list;
    }
Given a list of actions, remove anything that doesn't belong.
@param  Form      $form
@param  FieldList $actions
@return FieldList